Skip to content

Commit 16c7f9a

Browse files
committed
Fix Windows test failure in TelemetryHelperTest - allow Python SDK paths
Same issue as AmazonQStreamingClientTest - Python plugin scans for interpreters during IDE startup, attempting to access paths outside allowed test roots. Added @BeforeAll method (JUnit5 equivalent of @BeforeClass) to allow C:/Program Files access on Windows before IDE initialization.
1 parent efb1b35 commit 16c7f9a

File tree

1 file changed

+12
-0
lines changed
  • plugins/amazonq/chat/jetbrains-community/tst-253+/software/aws/toolkits/jetbrains/services/amazonq

1 file changed

+12
-0
lines changed

plugins/amazonq/chat/jetbrains-community/tst-253+/software/aws/toolkits/jetbrains/services/amazonq/TelemetryHelperTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
package software.aws.toolkits.jetbrains.services.amazonq
55

66
import com.intellij.openapi.application.ApplicationManager
7+
import com.intellij.openapi.util.Disposer
8+
import com.intellij.openapi.util.SystemInfo
9+
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
710
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
811
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
912
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
@@ -13,6 +16,7 @@ import kotlinx.coroutines.runBlocking
1316
import kotlinx.coroutines.test.runTest
1417
import org.assertj.core.api.Assertions.assertThat
1518
import org.junit.jupiter.api.AfterEach
19+
import org.junit.jupiter.api.BeforeAll
1620
import org.junit.jupiter.api.BeforeEach
1721
import org.junit.jupiter.api.Test
1822
import org.mockito.kotlin.any
@@ -102,6 +106,14 @@ class TelemetryHelperTest {
102106
private const val steRequestId = "sendTelemetryEventRequestId"
103107
private const val lang = "java"
104108
private val mockCustomization = CodeWhispererCustomization(customizationArn, "name", "description")
109+
110+
@JvmStatic
111+
@BeforeAll
112+
fun allowWindowsPythonPaths() {
113+
if (SystemInfo.isWindows) {
114+
VfsRootAccess.allowRootAccess(Disposer.newDisposable(), "C:/Program Files")
115+
}
116+
}
105117
private val data = ChatRequestData(
106118
tabId = tabId,
107119
message = "foo",

0 commit comments

Comments
 (0)