From 3c609288dd46caf9612f8a01f25156406b8f14db Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Mon, 30 Sep 2024 05:34:49 +0200 Subject: [PATCH] Skip Eel Local test on Windows on TC We now use `helper.py` which is a cumbersome because Windows agents do not have python by default. We need to use kotlin script to make helper both cross-platform and independent of the runtime. As for now, we simply disable in on the TC@Windows. GitOrigin-RevId: 0daf7f1d25cc57bb3afe1e6aace67ccb15637c04 --- .../intellij/execution/eel/EelLocalExecApiTest.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt b/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt index 9c3a9e569fcd..97462f9cc526 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/execution/eel/EelLocalExecApiTest.kt @@ -8,6 +8,7 @@ import com.intellij.platform.eel.EelExecApi import com.intellij.platform.eel.EelExecApi.Pty import com.intellij.platform.eel.EelProcess import com.intellij.platform.eel.impl.local.EelLocalExecApi +import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY import com.intellij.testFramework.common.timeoutRunBlocking import com.intellij.testFramework.junit5.TestApplication import com.intellij.util.io.write @@ -15,6 +16,8 @@ import org.hamcrest.CoreMatchers.anyOf import org.hamcrest.CoreMatchers.`is` import org.hamcrest.MatcherAssert.assertThat import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Assumptions.assumeFalse +import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.io.TempDir import org.junitpioneer.jupiter.cartesian.CartesianTest @@ -30,6 +33,13 @@ class EelLocalExecApiTest { private const val PTY_COLS = 42 private const val PTY_ROWS = 24 private val NEW_LINES = Regex("\r?\n") + + // TODO: Remove as soon as we migrate to kotlin script from the python + @BeforeAll + @JvmStatic + fun skipTestOnTcWindows() { + assumeFalse(SystemInfoRt.isWindows && IS_UNDER_TEAMCITY, "Test is disabled on TC@WIN as there is no python by default there") + } } private data class TtySize(val cols: Int, val rows: Int) @@ -40,8 +50,9 @@ class EelLocalExecApiTest { private val helperContent = EelLocalExecApiTest::class.java.classLoader.getResource("helper.py")!!.readBytes() - // TODO: This tests depends on python interpreter. Rewrite to something linked statically - private val python = Path.of(System.getenv(PYTHON_ENV) ?: "/usr/bin/python3") + // TODO: This tests depends on python interpreter. Rewrite to kotlin script + private val python = Path.of(System.getenv(PYTHON_ENV) + ?: if (!SystemInfoRt.isWindows) "/usr/bin/python3" else error("Provide $PYTHON_ENV env var with path to python")) @BeforeEach fun setUp() {