Skip to content

Commit

Permalink
Only run ArchUnit tests on JDKs < 24
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Sep 9, 2024
1 parent 1e50843 commit 3c51d92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ant-junit = { module = "org.apache.ant:ant-junit", version.ref = "ant" }
ant-junitlauncher = { module = "org.apache.ant:ant-junitlauncher", version.ref = "ant" }
apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" }

# check whether @DisabledForJreRange condition on ArchUnitTests can be updated when updating
# check whether the Java condition in platform-tooling-support-tests.gradle.kts can be changed when updating
archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "1.3.0" }

assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import com.gradle.develocity.agent.gradle.internal.test.TestDistributionConfigurationInternal
import junitbuild.extensions.capitalized
import org.gradle.api.tasks.PathSensitivity.RELATIVE
Expand Down Expand Up @@ -142,8 +143,10 @@ tasks.test {
jvmArgumentProviders += JarPath(project, antJarsClasspath.get(), "antJars")
jvmArgumentProviders += MavenDistribution(project, unzipMavenDistribution, mavenDistributionDir)

(options as JUnitPlatformOptions).apply {
includeEngines("archunit")
if (buildParameters.javaToolchain.version.orElse(21) < 24) {
(options as JUnitPlatformOptions).apply {
includeEngines("archunit")
}
}

inputs.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@

import org.apiguardian.api.API;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;

@DisabledForJreRange(min = JRE.JAVA_24)
@Order(Integer.MAX_VALUE)
@AnalyzeClasses(locations = ArchUnitTests.AllJars.class)
class ArchUnitTests {
Expand Down

0 comments on commit 3c51d92

Please sign in to comment.