Skip to content

Commit

Permalink
more conditional fips disable
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Dec 18, 2023
1 parent 01c4f8b commit a7def46
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.VersionProperties
import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE
import org.elasticsearch.gradle.internal.info.BuildParams

apply plugin: 'elasticsearch.internal-testclusters'
apply plugin: 'elasticsearch.standalone-rest-test'
Expand Down Expand Up @@ -53,16 +54,29 @@ testClusters.register('mixed-cluster') {
tasks.register('remote-cluster', RestIntegTestTask) {
mustRunAfter("precommit")
systemProperty 'tests.rest.suite', 'remote_cluster'
maybeDisableForFips(it)
}

tasks.register('mixed-cluster', RestIntegTestTask) {
dependsOn 'remote-cluster'
useCluster remoteCluster
systemProperty 'tests.rest.suite', 'multi_cluster'
maybeDisableForFips(it)
}

tasks.register("integTest") {
dependsOn 'mixed-cluster'
maybeDisableForFips(it)
}

tasks.named("check").configure { dependsOn("integTest") }

//TODO: remove with version 8.14. A new FIPS setting was adding in 8.13. Since FIPS configures all test clusters and this specific integTest uses
// the previous minor version, that setting is not available when running in FIPS until 8.14.
def maybeDisableForFips(task) {
if (BuildParams.inFipsJvm) {
if(Version.fromString(project.version).before(Version.fromString('8.14.0'))) {
task.enabled = false
}
}
}

0 comments on commit a7def46

Please sign in to comment.