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
This commit is contained in:
Ilya.Kazakevich
2025-08-06 23:27:57 +00:00
committed by intellij-monorepo-bot
parent ec95f4179f
commit 030246de49
4 changed files with 16 additions and 0 deletions
@@ -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
}
@@ -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}
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.TestOnly
internal class EelHolderImpl<T : Annotation>(val eelTestProvider: EelIjentTestProvider<T>, 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<T : Annotation>(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
@@ -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<T : Annotation> {
val eelType: EelType
val name: String
val mandatoryAnnotationClass: KClass<T>