From 030246de49d355fa0314294a0f123ac042ed3bda Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 6 Aug 2025 21:50:18 +0200 Subject: [PATCH] Add eel type to the eel test provider to check it in tests. Sometimes your test code doesn't work on certain envs. As a temporary solution you can skip test based on this field GitOrigin-RevId: e235a3702e4327b546ce3dd909287c77ad651157 --- .../testFramework/junit5/eel/test/params/api/EelHolder.kt | 5 +++++ .../testFramework/junit5/eel/test/params/api/EelType.kt | 7 +++++++ platform/testFramework/junit5/eel/test/params/api/impl.kt | 2 ++ .../junit5/eel/test/params/spi/EelIjentTestProvider.kt | 2 ++ 4 files changed, 16 insertions(+) create mode 100644 platform/testFramework/junit5/eel/test/params/api/EelType.kt diff --git a/platform/testFramework/junit5/eel/test/params/api/EelHolder.kt b/platform/testFramework/junit5/eel/test/params/api/EelHolder.kt index a6fdb2956854..fc96eab6fce6 100644 --- a/platform/testFramework/junit5/eel/test/params/api/EelHolder.kt +++ b/platform/testFramework/junit5/eel/test/params/api/EelHolder.kt @@ -21,4 +21,9 @@ sealed interface EelHolder { * Consider using [eel] in a new code. */ val target: TargetEnvironmentConfiguration? + + /** + * For those rare cases when you need to test something WSL or Docker-specific. Do not use unless absolutely necessary. + */ + val type: EelType } \ No newline at end of file diff --git a/platform/testFramework/junit5/eel/test/params/api/EelType.kt b/platform/testFramework/junit5/eel/test/params/api/EelType.kt new file mode 100644 index 000000000000..cf6af4f5508b --- /dev/null +++ b/platform/testFramework/junit5/eel/test/params/api/EelType.kt @@ -0,0 +1,7 @@ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.platform.testFramework.junit5.eel.params.api + +import org.jetbrains.annotations.ApiStatus + +@ApiStatus.Internal +enum class EelType {LOCAL, WSL, DOCKER} \ No newline at end of file diff --git a/platform/testFramework/junit5/eel/test/params/api/impl.kt b/platform/testFramework/junit5/eel/test/params/api/impl.kt index 50a61eb4a131..e92c33150e03 100644 --- a/platform/testFramework/junit5/eel/test/params/api/impl.kt +++ b/platform/testFramework/junit5/eel/test/params/api/impl.kt @@ -13,6 +13,7 @@ import org.jetbrains.annotations.TestOnly internal class EelHolderImpl(val eelTestProvider: EelIjentTestProvider, val annotation: T?) : EelHolder { override lateinit var eel: IjentApi override var target: TargetEnvironmentConfiguration? = null + override val type: EelType = eelTestProvider.eelType override fun toString(): String = buildString { append(eelTestProvider.name) @@ -26,6 +27,7 @@ internal class EelHolderImpl(val eelTestProvider: EelIjentTestPr @TestOnly internal object LocalEelHolder : EelHolder { + override val type: EelType = EelType.LOCAL override val eel: EelApi get() = localEel override fun toString(): String = "Local" override val target: TargetEnvironmentConfiguration? = null diff --git a/platform/testFramework/junit5/eel/test/params/spi/EelIjentTestProvider.kt b/platform/testFramework/junit5/eel/test/params/spi/EelIjentTestProvider.kt index 61fb3b1c0cb0..4d88d4adeb7b 100644 --- a/platform/testFramework/junit5/eel/test/params/spi/EelIjentTestProvider.kt +++ b/platform/testFramework/junit5/eel/test/params/spi/EelIjentTestProvider.kt @@ -3,6 +3,7 @@ package com.intellij.platform.testFramework.junit5.eel.params.spi import com.intellij.execution.target.TargetEnvironmentConfiguration import com.intellij.platform.ijent.IjentApi +import com.intellij.platform.testFramework.junit5.eel.params.api.EelType import kotlinx.coroutines.CoroutineScope import org.jetbrains.annotations.TestOnly import java.io.Closeable @@ -14,6 +15,7 @@ import kotlin.reflect.KClass */ @TestOnly interface EelIjentTestProvider { + val eelType: EelType val name: String val mandatoryAnnotationClass: KClass