Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
import org.elasticsearch.gradle.test.RestIntegTestTask

subprojects { Project subproj ->
subproj.ext {
String bwcFlavor = System.getProperty('bwcFlavor')
switch (bwcFlavor) {
case 'oss':
runOssUpgrades = true;
runDefaultUpgrades = false;
break;
case 'default':
runOssUpgrades = false;
runDefaultUpgrades = true;
break;
case null:
runOssUpgrades = true;
runDefaultUpgrades = true;
break;
default:
throw new InvalidUserDataException("Unknown bwc flavor ${bwcFlavor}")
}
}
subproj.tasks.withType(RestIntegTestTask) {
subproj.extensions.configure("${it.name}Cluster") { cluster ->
cluster.distribution = 'oss-zip'
Expand Down
36 changes: 26 additions & 10 deletions qa/full-cluster-restart/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ task bwcTest {
description = 'Runs backwards compatibility tests.'
group = 'verification'
}
task integTest {
description = 'Runs backwards comaptibility tests for recent versions.'
group = 'verification'
}

for (Version version : bwcVersions.indexCompatible) {
String baseName = "v${version}"
void setupBwcTests(Version version, String fromDistribution, String toDistribution) {
String baseName = "v${version}-${fromDistribution}-to-${toDistribution}"

Task oldClusterTest = tasks.create(name: "${baseName}#oldClusterTest", type: RestIntegTestTask) {
mustRunAfter(precommit)
Expand All @@ -49,6 +53,7 @@ for (Version version : bwcVersions.indexCompatible) {
numBwcNodes = 2
numNodes = 2
clusterName = 'full-cluster-restart'
distribution = fromDistribution

// some tests rely on the translog not being flushed
setting 'indices.memory.shard_inactive_time', '20m'
Expand All @@ -71,6 +76,7 @@ for (Version version : bwcVersions.indexCompatible) {
"${baseName}#oldClusterTestCluster#node0.stop",
"${baseName}#oldClusterTestCluster#node1.stop"
clusterName = 'full-cluster-restart'
distribution = toDistribution

// some tests rely on the translog not being flushed
setting 'indices.memory.shard_inactive_time', '20m'
Expand All @@ -96,19 +102,29 @@ for (Version version : bwcVersions.indexCompatible) {

if (project.bwc_tests_enabled) {
bwcTest.dependsOn(versionBwcTest)
if (bwcVersions.snapshotsIndexCompatible.contains(version)) {
// basic integ tests includes testing bwc against the most recent version
integTest.dependsOn(versionBwcTest)
}
}
}

test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
test.enabled = false // no unit tests for full cluster upgrades, only the rest integration test

// basic integ tests includes testing bwc against the most recent version
task integTest {
if (project.bwc_tests_enabled) {
for (final def version : bwcVersions.snapshotsIndexCompatible) {
dependsOn "v${version}#bwcTest"
}
String bwcFlavor = System.getProperty('bwcFlavor')
for (Version version : bwcVersions.indexCompatible) {
if (runOssUpgrades) {
setupBwcTests(version, 'oss-zip', 'oss-zip')
}
if (runDefaultUpgrades) {
/*
* If the source version is before xpack was opened then test upgrading
* from OSS to the default distribution because we expect that'll be
* fairly common. If it is after opening xpack then test upgrading xpack
* default to xpack default. zip-to-zip covers both of those cases.
*/
setupBwcTests(version, 'zip', 'zip')
}
}

check.dependsOn(integTest)

37 changes: 27 additions & 10 deletions qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ task bwcTest {
description = 'Runs backwards compatibility tests.'
group = 'verification'
}
task integTest {
description = 'Runs backwards comaptibility tests for recent versions.'
group = 'verification'
}

for (Version version : bwcVersions.wireCompatible) {
String baseName = "v${version}"
void setupBwcTests(Version version, String fromDistribution, String toDistribution) {
String baseName = "v${version}-${fromDistribution}-to-${toDistribution}"

Task oldClusterTest = tasks.create(name: "${baseName}#oldClusterTest", type: RestIntegTestTask) {
mustRunAfter(precommit)
Expand All @@ -42,6 +46,7 @@ for (Version version : bwcVersions.wireCompatible) {
numBwcNodes = 2
numNodes = 2
clusterName = 'rolling-upgrade'
distribution = fromDistribution
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
if (version.onOrAfter('5.3.0')) {
setting 'http.content_type.required', 'true'
Expand All @@ -63,6 +68,7 @@ for (Version version : bwcVersions.wireCompatible) {
/* Override the data directory so the new node always gets the node we
* just stopped's data directory. */
dataDir = { nodeNumber -> oldClusterTest.nodes[1].dataDir }
distribution = toDistribution
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
}

Expand All @@ -82,6 +88,7 @@ for (Version version : bwcVersions.wireCompatible) {
/* Override the data directory so the new node always gets the node we
* just stopped's data directory. */
dataDir = { nodeNumber -> oldClusterTest.nodes[0].dataDir}
distribution = toDistribution
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
}

Expand All @@ -99,18 +106,28 @@ for (Version version : bwcVersions.wireCompatible) {

if (project.bwc_tests_enabled) {
bwcTest.dependsOn(versionBwcTest)
if (bwcVersions.snapshotsWireCompatible.contains(version)) {
// basic integ tests includes testing bwc against the most recent version
integTest.dependsOn(versionBwcTest)
}
}
}

test.enabled = false // no unit tests for rolling upgrades, only the rest integration test

// basic integ tests includes testing bwc against the most recent version
task integTest {
if (project.bwc_tests_enabled) {
for (final def version : bwcVersions.snapshotsWireCompatible) {
dependsOn "v${version}#bwcTest"
}
for (Version version : bwcVersions.wireCompatible) {
if (runOssUpgrades) {
setupBwcTests(version, 'oss-zip', 'oss-zip')
}
if (runDefaultUpgrades) {
/*
* If the source version is before xpack was opened then test upgrading
* from OSS to the default distribution because we expect that'll be
* fairly common. If it is after opening xpack then test upgrading xpack
* default to xpack default. zip-to-zip covers both of those cases.
*/
setupBwcTests(version, 'zip', 'zip')
}
}

test.enabled = false // no unit tests for rolling upgrades, only the rest integration test

check.dependsOn(integTest)