Skip to content

Commit

Permalink
Introduce environment variable to disable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Nov 4, 2023
1 parent 9011a16 commit e13fece
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import java.util.stream.Stream
const val useK2PropertyCLIArgument = "-Porg.jetbrains.dokka.useK2=true"
internal class LatestTestedVersionsArgumentsProvider : TestedVersionsArgumentsProvider(listOf(TestedVersions.LATEST))
internal open class AllSupportedTestedVersionsArgumentsProvider : TestedVersionsArgumentsProvider(TestedVersions.ALL_SUPPORTED)
internal open class AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider : TestedVersionsWithK2SwitcherArgumentsProvider(listOf(TestedVersions.LATEST))
internal open class AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider : TestedVersionsWithK2SwitcherArgumentsProvider(TestedVersions.ALL_SUPPORTED)

internal object TestedVersions {

Expand Down Expand Up @@ -76,8 +76,14 @@ abstract class TestedVersionsArgumentsProvider(private val buildVersions: List<B
/**
* The first argument is [BuildVersions], the second one is an extra CLI argument for Gradle
*/
internal abstract class TestedVersionsWithK2SwitcherArgumentsProvider(private val buildVersions: List<BuildVersions>) : ArgumentsProvider {
internal abstract class TestedVersionsWithK2SwitcherArgumentsProvider(private val buildVersions: List<BuildVersions>) :
ArgumentsProvider {
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> {
return (buildVersions.map { Arguments.of(it, "") } + buildVersions.map { Arguments.of(it, useK2PropertyCLIArgument) }).stream()
return (buildVersions.map { Arguments.of(it, "") } + if (TestEnvironment.disableK2Tests) emptyList()
else buildVersions.map {
Arguments.of(
it, useK2PropertyCLIArgument
)
}).stream()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public object TestEnvironment {
public val isExhaustive: Boolean = checkNotNull(System.getenv("isExhaustive")) {
"Missing `isExhaustive` environment variable"
}.toBoolean()

public val disableK2Tests: Boolean = System.getenv("DISABLE_K2_TESTS").toBoolean()
}

/**
Expand Down

0 comments on commit e13fece

Please sign in to comment.