Skip to content

Commit ea76b2c

Browse files
authored
Expand bcUpgradeTask to run more test suites. (elastic#128983) (elastic#129400)
Relates to ES-11904
1 parent d1ac311 commit ea76b2c

File tree

12 files changed

+34
-18
lines changed

12 files changed

+34
-18
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import org.elasticsearch.gradle.Version
11+
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
12+
13+
tasks.register("bcUpgradeTest", StandaloneRestIntegTestTask) {
14+
// We use a phony version here as the real version is provided via `tests.bwc.main.version` system property
15+
usesBwcDistribution(Version.fromString("0.0.0"))
16+
systemProperty("tests.old_cluster_version", "0.0.0")
17+
onlyIf("tests.bwc.main.version system property exists") { System.getProperty("tests.bwc.main.version") != null }
18+
}

modules/ingest-geoip/qa/full-cluster-restart/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1111

1212
apply plugin: 'elasticsearch.internal-java-rest-test'
1313
apply plugin: 'elasticsearch.bwc-test'
14-
14+
apply plugin: 'elasticsearch.bc-upgrade-test'
1515

1616
dependencies {
1717
javaRestTestImplementation project(':test:fixtures:geoip-fixture')

qa/full-cluster-restart/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1313
apply plugin: 'elasticsearch.internal-java-rest-test'
1414
apply plugin: 'elasticsearch.internal-test-artifact'
1515
apply plugin: 'elasticsearch.bwc-test'
16+
apply plugin: 'elasticsearch.bc-upgrade-test'
1617

1718
buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
1819
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {

qa/rolling-upgrade/build.gradle

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test'
1414
apply plugin: 'elasticsearch.internal-test-artifact-base'
1515
apply plugin: 'elasticsearch.bwc-test'
1616
apply plugin: 'elasticsearch.fwc-test'
17+
apply plugin: 'elasticsearch.bc-upgrade-test'
1718

1819
testArtifacts {
1920
registerTestArtifactFromSourceSet(sourceSets.javaRestTest)
@@ -26,18 +27,6 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
2627
}
2728
}
2829

29-
tasks.register("bcUpgradeTest", StandaloneRestIntegTestTask) {
30-
// We use a phony version here as the real version is provided via `tests.bwc.main.version` system property
31-
usesBwcDistribution(Version.fromString("0.0.0"))
32-
systemProperty("tests.old_cluster_version", "0.0.0")
33-
onlyIf("tests.bwc.main.version system property exists") { System.getProperty("tests.bwc.main.version") != null }
34-
filter {
35-
// filter tests initially for quicker iterations
36-
// TODO remove once expanding the test set to other modules
37-
includeTestsMatching("org.elasticsearch.upgrades.IndexingIT")
38-
}
39-
}
40-
4130
tasks.withType(Test).configureEach {
4231
// CI doesn't like it when there's multiple clusters running at once
4332
maxParallelForks = 1

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterSpec.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ public Path getConfigDir() {
212212
}
213213

214214
public boolean isSecurityEnabled() {
215-
return Boolean.parseBoolean(getSetting("xpack.security.enabled", getVersion().onOrAfter("8.0.0") ? "true" : "false"));
215+
return Boolean.parseBoolean(
216+
getSetting(
217+
"xpack.security.enabled",
218+
getVersion().equals(Version.fromString("0.0.0")) || getVersion().onOrAfter("8.0.0") ? "true" : "false"
219+
)
220+
);
216221
}
217222

218223
public boolean isRemoteClusterServerEnabled() {

x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
99

1010
apply plugin: 'elasticsearch.internal-java-rest-test'
1111
apply plugin: 'elasticsearch.bwc-test'
12-
12+
apply plugin: 'elasticsearch.bc-upgrade-test'
1313

1414
dependencies {
1515
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))

x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test'
1414
apply plugin: 'elasticsearch.internal-yaml-rest-test'
1515
apply plugin: 'elasticsearch.internal-test-artifact'
1616
apply plugin: 'elasticsearch.bwc-test'
17+
apply plugin: 'elasticsearch.bc-upgrade-test'
1718

1819
restResources {
1920
restApi {

x-pack/plugin/inference/qa/mixed-cluster/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1212
apply plugin: 'elasticsearch.internal-java-rest-test'
1313
apply plugin: 'elasticsearch.internal-test-artifact-base'
1414
apply plugin: 'elasticsearch.bwc-test'
15+
apply plugin: 'elasticsearch.bc-upgrade-test'
1516

1617
dependencies {
1718
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
@@ -37,4 +38,3 @@ buildParams.bwcVersions.withWireCompatible(supportedVersion) { bwcVersion, baseN
3738
dependsOn javaRestTest
3839
}
3940
}
40-

x-pack/plugin/inference/qa/rolling-upgrade/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1010
apply plugin: 'elasticsearch.internal-java-rest-test'
1111
apply plugin: 'elasticsearch.internal-test-artifact-base'
1212
apply plugin: 'elasticsearch.bwc-test'
13-
13+
apply plugin: 'elasticsearch.bc-upgrade-test'
1414

1515
dependencies {
1616
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
@@ -26,4 +26,3 @@ buildParams.bwcVersions.withWireCompatible(v -> v.after("8.11.0")) { bwcVersion,
2626
maxParallelForks = 1
2727
}
2828
}
29-

x-pack/plugin/security/qa/multi-cluster/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1010
apply plugin: 'elasticsearch.internal-java-rest-test'
1111
apply plugin: 'elasticsearch.rest-resources'
1212
apply plugin: 'elasticsearch.bwc-test'
13+
apply plugin: 'elasticsearch.bc-upgrade-test'
1314

1415
dependencies {
1516
javaRestTestImplementation project(':x-pack:plugin:core')

0 commit comments

Comments
 (0)