Limit full cluster restart upgrade tests to wire compatible versions (#82445)

This commit is contained in:
Mark Vieira 2022-01-11 14:27:56 -08:00 committed by GitHub
parent bbc685c5ba
commit e6ba67f973
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 23 additions and 23 deletions

View file

@ -236,11 +236,11 @@ public class BwcVersions {
); );
} }
public void withIndexCompatiple(BiConsumer<Version, String> versionAction) { public void withIndexCompatible(BiConsumer<Version, String> versionAction) {
getIndexCompatible().forEach(v -> versionAction.accept(v, "v" + v.toString())); getIndexCompatible().forEach(v -> versionAction.accept(v, "v" + v.toString()));
} }
public void withIndexCompatiple(Predicate<Version> filter, BiConsumer<Version, String> versionAction) { public void withIndexCompatible(Predicate<Version> filter, BiConsumer<Version, String> versionAction) {
getIndexCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v" + v.toString())); getIndexCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v" + v.toString()));
} }
@ -250,11 +250,11 @@ public class BwcVersions {
); );
} }
public void withWireCompatiple(BiConsumer<Version, String> versionAction) { public void withWireCompatible(BiConsumer<Version, String> versionAction) {
getWireCompatible().forEach(v -> versionAction.accept(v, "v" + v.toString())); getWireCompatible().forEach(v -> versionAction.accept(v, "v" + v.toString()));
} }
public void withWireCompatiple(Predicate<Version> filter, BiConsumer<Version, String> versionAction) { public void withWireCompatible(Predicate<Version> filter, BiConsumer<Version, String> versionAction) {
getWireCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v" + v.toString())); getWireCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v" + v.toString()));
} }

View file

@ -132,7 +132,7 @@ public class DistroTestPlugin implements Plugin<Project> {
lifecycleTasks.get(distribution.getType()).configure(t -> t.dependsOn(destructiveTask)); lifecycleTasks.get(distribution.getType()).configure(t -> t.dependsOn(destructiveTask));
if ((distribution.getType() == DEB || distribution.getType() == RPM) && distribution.getBundledJdk()) { if ((distribution.getType() == DEB || distribution.getType() == RPM) && distribution.getBundledJdk()) {
for (Version version : BuildParams.getBwcVersions().getIndexCompatible()) { for (Version version : BuildParams.getBwcVersions().getWireCompatible()) {
final ElasticsearchDistribution bwcDistro; final ElasticsearchDistribution bwcDistro;
if (version.equals(Version.fromString(distribution.getVersion()))) { if (version.equals(Version.fromString(distribution.getVersion()))) {
// this is the same as the distribution we are testing // this is the same as the distribution we are testing
@ -248,7 +248,7 @@ public class DistroTestPlugin implements Plugin<Project> {
private static Map<String, TaskProvider<?>> versionTasks(Project project, String taskPrefix) { private static Map<String, TaskProvider<?>> versionTasks(Project project, String taskPrefix) {
Map<String, TaskProvider<?>> versionTasks = new HashMap<>(); Map<String, TaskProvider<?>> versionTasks = new HashMap<>();
for (Version version : BuildParams.getBwcVersions().getIndexCompatible()) { for (Version version : BuildParams.getBwcVersions().getWireCompatible()) {
versionTasks.put(version.toString(), project.getTasks().register(taskPrefix + ".v" + version)); versionTasks.put(version.toString(), project.getTasks().register(taskPrefix + ".v" + version));
} }

View file

@ -18,7 +18,7 @@ dependencies {
testImplementation project(':client:rest-high-level') testImplementation project(':client:rest-high-level')
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
/** /**
* We execute tests 3 times. * We execute tests 3 times.

View file

@ -15,7 +15,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact' apply plugin: 'elasticsearch.internal-test-artifact'
apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.bwc-test'
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {
versions = [bwcVersion.toString(), project.version] versions = [bwcVersion.toString(), project.version]
numberOfNodes = 2 numberOfNodes = 2

View file

@ -21,7 +21,7 @@ restResources {
} }
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
if (bwcVersion != VersionProperties.getElasticsearchVersion()) { if (bwcVersion != VersionProperties.getElasticsearchVersion()) {
/* This project runs the core REST tests against a 4 node cluster where two of /* This project runs the core REST tests against a 4 node cluster where two of

View file

@ -19,7 +19,7 @@ dependencies {
testImplementation project(':client:rest-high-level') testImplementation project(':client:rest-high-level')
} }
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
String oldClusterName = "${baseName}-old" String oldClusterName = "${baseName}-old"
String newClusterName = "${baseName}-new" String newClusterName = "${baseName}-new"

View file

@ -14,7 +14,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.bwc-test'
apply plugin: 'elasticsearch.rest-resources' apply plugin: 'elasticsearch.rest-resources'
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
/* /*
* The goal here is to: * The goal here is to:
* <ul> * <ul>

View file

@ -14,7 +14,7 @@ apply plugin: 'elasticsearch.internal-testclusters'
apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.bwc-test'
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {
version = bwcVersion.toString() version = bwcVersion.toString()
setting 'xpack.security.enabled', 'true' setting 'xpack.security.enabled', 'true'

View file

@ -15,7 +15,7 @@ dependencies {
tasks.named("integTest").configure { enabled = false } tasks.named("integTest").configure { enabled = false }
BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.0") && BuildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("7.10.0") &&
v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName ->
def cluster = testClusters.register(baseName) { def cluster = testClusters.register(baseName) {
versions = [bwcVersion.toString(), project.version] versions = [bwcVersion.toString(), project.version]

View file

@ -29,7 +29,7 @@ tasks.register("copyTestNodeKeyMaterial", Copy) {
into outputDir into outputDir
} }
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {
testDistribution = "DEFAULT" testDistribution = "DEFAULT"
versions = [bwcVersion.toString(), project.version] versions = [bwcVersion.toString(), project.version]

View file

@ -37,7 +37,7 @@ tasks.register("copyTestNodeKeyMaterial", Copy) {
into outputDir into outputDir
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
String oldVersion = bwcVersion.toString() String oldVersion = bwcVersion.toString()
// SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests // SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests

View file

@ -71,7 +71,7 @@ subprojects {
} }
// Configure compatibility testing tasks // Configure compatibility testing tasks
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
// Compatibility testing for JDBC driver started with version 7.9.0 // Compatibility testing for JDBC driver started with version 7.9.0
if (bwcVersion.onOrAfter(Version.fromString("7.9.0")) && (bwcVersion.equals(VersionProperties.elasticsearchVersion) == false)) { if (bwcVersion.onOrAfter(Version.fromString("7.9.0")) && (bwcVersion.equals(VersionProperties.elasticsearchVersion) == false)) {
UnreleasedVersionInfo unreleasedVersion = BuildParams.bwcVersions.unreleasedInfo(bwcVersion) UnreleasedVersionInfo unreleasedVersion = BuildParams.bwcVersions.unreleasedInfo(bwcVersion)

View file

@ -21,7 +21,7 @@ testClusters.configureEach {
tasks.named("integTest").configure{ enabled = false} tasks.named("integTest").configure{ enabled = false}
// A bug (https://github.com/elastic/elasticsearch/issues/68439) limits us to perform tests with versions from 7.10.3 onwards // A bug (https://github.com/elastic/elasticsearch/issues/68439) limits us to perform tests with versions from 7.10.3 onwards
BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.3") && BuildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("7.10.3") &&
v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {

View file

@ -29,7 +29,7 @@ tasks.register("copyTestNodeKeyMaterial", Copy) {
into outputDir into outputDir
} }
BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {
testDistribution = "DEFAULT" testDistribution = "DEFAULT"
versions = [bwcVersion.toString(), project.version] versions = [bwcVersion.toString(), project.version]

View file

@ -12,7 +12,7 @@ dependencies {
} }
// Only run tests for 7.9+, since the node.roles setting was introduced in 7.9.0 // Only run tests for 7.9+, since the node.roles setting was introduced in 7.9.0
BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.9.0") && BuildParams.bwcVersions.withWireCompatible(v -> v.onOrAfter("7.9.0") &&
v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {

View file

@ -9,7 +9,7 @@ dependencies {
testImplementation project(':x-pack:qa') testImplementation project(':x-pack:qa')
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseCluster = testClusters.register(baseName) { def baseCluster = testClusters.register(baseName) {
testDistribution = "DEFAULT" testDistribution = "DEFAULT"
versions = [bwcVersion.toString(), project.version] versions = [bwcVersion.toString(), project.version]

View file

@ -9,7 +9,7 @@ dependencies {
testImplementation project(':x-pack:qa') testImplementation project(':x-pack:qa')
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
def baseLeaderCluster = testClusters.register("${baseName}-leader") { def baseLeaderCluster = testClusters.register("${baseName}-leader") {
numberOfNodes = 3 numberOfNodes = 3

View file

@ -30,7 +30,7 @@ tasks.register("copyTestNodeKeyMaterial", Copy) {
into outputDir into outputDir
} }
BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
String oldVersion = bwcVersion.toString() String oldVersion = bwcVersion.toString()
// SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests // SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests