Handle "current" being dropped from the list of released versions

Original commit: elastic/x-pack-elasticsearch@46668ce672
This commit is contained in:
Nik Everett 2017-06-09 23:29:07 -04:00
parent 1af9f56834
commit 65a0d44b2f
1 changed files with 4 additions and 13 deletions

View File

@ -100,12 +100,11 @@ public abstract class AbstractOldXPackIndicesBackwardsCompatibilityTestCase exte
public void testAllVersionsTested() throws Exception { public void testAllVersionsTested() throws Exception {
SortedSet<String> expectedVersions = new TreeSet<>(); SortedSet<String> expectedVersions = new TreeSet<>();
for (Version v : VersionUtils.allReleasedVersions()) { for (Version v : VersionUtils.allReleasedVersions()) {
if (false == shouldTestVersion(v)) continue; if (v.isRelease()) {
if (v.before(Version.CURRENT.minimumIndexCompatibilityVersion())) continue; // we can only support one major version backward // no guarantees for prereleases
if (v.equals(Version.CURRENT)) continue; // the current version is always compatible with itself
if (v.isBeta() == true || v.isAlpha() == true || v.isRC() == true) continue; // don't check alphas etc
expectedVersions.add("x-pack-" + v.toString() + ".zip"); expectedVersions.add("x-pack-" + v.toString() + ".zip");
} }
}
expectedVersions.removeAll(dataFiles); expectedVersions.removeAll(dataFiles);
if (expectedVersions.isEmpty() == false) { if (expectedVersions.isEmpty() == false) {
StringBuilder msg = new StringBuilder("Old index tests are missing indexes:"); StringBuilder msg = new StringBuilder("Old index tests are missing indexes:");
@ -121,7 +120,6 @@ public abstract class AbstractOldXPackIndicesBackwardsCompatibilityTestCase exte
Collections.shuffle(dataFiles, random()); Collections.shuffle(dataFiles, random());
for (String dataFile : dataFiles) { for (String dataFile : dataFiles) {
Version version = Version.fromString(dataFile.replace("x-pack-", "").replace(".zip", "")); Version version = Version.fromString(dataFile.replace("x-pack-", "").replace(".zip", ""));
if (false == shouldTestVersion(version)) continue;
long clusterStartTime = System.nanoTime(); long clusterStartTime = System.nanoTime();
setupCluster(dataFile); setupCluster(dataFile);
ensureYellow(); ensureYellow();
@ -137,13 +135,6 @@ public abstract class AbstractOldXPackIndicesBackwardsCompatibilityTestCase exte
} }
} }
/**
* Should we test this version at all? Called before loading the data directory. Return false to skip it entirely.
*/
protected boolean shouldTestVersion(Version version) {
return true;
}
/** /**
* Actually test this version. * Actually test this version.
*/ */