diff --git a/build-tools-internal/src/main/groovy/elasticsearch.bc-upgrade-test.gradle b/build-tools-internal/src/main/groovy/elasticsearch.bc-upgrade-test.gradle new file mode 100644 index 0000000000000..94702c840c745 --- /dev/null +++ b/build-tools-internal/src/main/groovy/elasticsearch.bc-upgrade-test.gradle @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import org.elasticsearch.gradle.Version +import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask + +tasks.register("bcUpgradeTest", StandaloneRestIntegTestTask) { + // We use a phony version here as the real version is provided via `tests.bwc.main.version` system property + usesBwcDistribution(Version.fromString("0.0.0")) + systemProperty("tests.old_cluster_version", "0.0.0") + onlyIf("tests.bwc.main.version system property exists") { System.getProperty("tests.bwc.main.version") != null } +} diff --git a/modules/ingest-geoip/qa/full-cluster-restart/build.gradle b/modules/ingest-geoip/qa/full-cluster-restart/build.gradle index b6613b51ac8fc..5be9c652e3e90 100644 --- a/modules/ingest-geoip/qa/full-cluster-restart/build.gradle +++ b/modules/ingest-geoip/qa/full-cluster-restart/build.gradle @@ -11,7 +11,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.bwc-test' - +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { javaRestTestImplementation project(':test:fixtures:geoip-fixture') diff --git a/qa/full-cluster-restart/build.gradle b/qa/full-cluster-restart/build.gradle index d23267bb352fc..16f7abc183421 100644 --- a/qa/full-cluster-restart/build.gradle +++ b/qa/full-cluster-restart/build.gradle @@ -13,6 +13,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-test-artifact' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName -> tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) { diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index 9a2fb22da5e39..aef0ea6cdae0a 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -14,6 +14,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-test-artifact-base' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.fwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' testArtifacts { registerTestArtifactFromSourceSet(sourceSets.javaRestTest) @@ -26,18 +27,6 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName -> } } -tasks.register("bcUpgradeTest", StandaloneRestIntegTestTask) { - // We use a phony version here as the real version is provided via `tests.bwc.main.version` system property - usesBwcDistribution(Version.fromString("0.0.0")) - systemProperty("tests.old_cluster_version", "0.0.0") - onlyIf("tests.bwc.main.version system property exists") { System.getProperty("tests.bwc.main.version") != null } - filter { - // filter tests initially for quicker iterations - // TODO remove once expanding the test set to other modules - includeTestsMatching("org.elasticsearch.upgrades.IndexingIT") - } -} - tasks.withType(Test).configureEach { // CI doesn't like it when there's multiple clusters running at once maxParallelForks = 1 diff --git a/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterSpec.java b/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterSpec.java index cccf2a95234c9..633381cefbbbb 100644 --- a/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterSpec.java +++ b/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterSpec.java @@ -212,7 +212,12 @@ public Path getConfigDir() { } public boolean isSecurityEnabled() { - return Boolean.parseBoolean(getSetting("xpack.security.enabled", getVersion().onOrAfter("8.0.0") ? "true" : "false")); + return Boolean.parseBoolean( + getSetting( + "xpack.security.enabled", + getVersion().equals(Version.fromString("0.0.0")) || getVersion().onOrAfter("8.0.0") ? "true" : "false" + ) + ); } public boolean isRemoteClusterServerEnabled() { diff --git a/x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle b/x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle index 1e1973a118074..ab6d803a8211c 100644 --- a/x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle +++ b/x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle @@ -9,7 +9,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.bwc-test' - +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle b/x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle index 971eed1c6795d..837817f98e8ff 100644 --- a/x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle +++ b/x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle @@ -14,6 +14,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-yaml-rest-test' apply plugin: 'elasticsearch.internal-test-artifact' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' restResources { restApi { diff --git a/x-pack/plugin/inference/qa/mixed-cluster/build.gradle b/x-pack/plugin/inference/qa/mixed-cluster/build.gradle index 0f8c732154e85..eb775bb096b2e 100644 --- a/x-pack/plugin/inference/qa/mixed-cluster/build.gradle +++ b/x-pack/plugin/inference/qa/mixed-cluster/build.gradle @@ -12,6 +12,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-test-artifact-base' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) @@ -37,4 +38,3 @@ buildParams.bwcVersions.withWireCompatible(supportedVersion) { bwcVersion, baseN dependsOn javaRestTest } } - diff --git a/x-pack/plugin/inference/qa/rolling-upgrade/build.gradle b/x-pack/plugin/inference/qa/rolling-upgrade/build.gradle index 214d775b46236..0bdc23c0e8600 100644 --- a/x-pack/plugin/inference/qa/rolling-upgrade/build.gradle +++ b/x-pack/plugin/inference/qa/rolling-upgrade/build.gradle @@ -10,7 +10,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.internal-test-artifact-base' apply plugin: 'elasticsearch.bwc-test' - +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) @@ -26,4 +26,3 @@ buildParams.bwcVersions.withWireCompatible(v -> v.after("8.11.0")) { bwcVersion, maxParallelForks = 1 } } - diff --git a/x-pack/plugin/security/qa/multi-cluster/build.gradle b/x-pack/plugin/security/qa/multi-cluster/build.gradle index f4eee4ef46c02..6cbabbabe00ce 100644 --- a/x-pack/plugin/security/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/security/qa/multi-cluster/build.gradle @@ -10,6 +10,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.rest-resources' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { javaRestTestImplementation project(':x-pack:plugin:core') diff --git a/x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle b/x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle index 60b0b372ba14c..d2b4219505901 100644 --- a/x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle +++ b/x-pack/plugin/shutdown/qa/full-cluster-restart/build.gradle @@ -9,6 +9,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { // TODO: Remove core dependency and change tests to not use builders that are part of xpack-core. diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle index ee0955c6db082..1a22c1493958f 100644 --- a/x-pack/qa/full-cluster-restart/build.gradle +++ b/x-pack/qa/full-cluster-restart/build.gradle @@ -9,6 +9,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask apply plugin: 'elasticsearch.internal-java-rest-test' apply plugin: 'elasticsearch.bwc-test' +apply plugin: 'elasticsearch.bc-upgrade-test' dependencies { // TODO: Remove core dependency and change tests to not use builders that are part of xpack-core.