Skip to content

Commit a11edba

Browse files
committed
Fix Windows test - use @BeforeClass for VfsRootAccess before IDE startup
Python plugin scans during IDE startup, before @before runs. Use @BeforeClass with Disposer.newDisposable() to allow access earlier.
1 parent c172725 commit a11edba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/amazonq/chat/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/clients/AmazonQStreamingClientTest.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package software.aws.toolkits.jetbrains.services.amazonq.clients
55

6+
import com.intellij.openapi.util.Disposer
67
import com.intellij.openapi.util.SystemInfo
78
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
89
import com.intellij.testFramework.RuleChain
@@ -11,6 +12,7 @@ import kotlinx.coroutines.runBlocking
1112
import kotlinx.coroutines.test.runTest
1213
import org.assertj.core.api.Assertions.assertThat
1314
import org.junit.Before
15+
import org.junit.BeforeClass
1416
import org.junit.Rule
1517
import org.junit.Test
1618
import org.mockito.kotlin.any
@@ -241,6 +243,14 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
241243
}
242244

243245
companion object {
246+
@JvmStatic
247+
@BeforeClass
248+
fun allowWindowsPythonPaths() {
249+
if (SystemInfo.isWindows) {
250+
VfsRootAccess.allowRootAccess(Disposer.newDisposable(), "C:/Program Files")
251+
}
252+
}
253+
244254
private val VALIDATION_EXCEPTION = ValidationException.builder()
245255
.message("Resource validation failed")
246256
.build()

0 commit comments

Comments
 (0)