Fix generation of versions to upgrade from

Vagrant tests use a static list of dependencies to upgrade from
and we weren't including 5.0.0 deps in that list. Also when the
list was incorrect we weren't sorting the "current" list so it
was difficult to read.

Also adds 2.4.1 to the list but *doesn't* add 5.0.0 because we
still can't resolve it yet. We still only print an error when
the list is wrong but don't abort the build. We'll abort the build
once we've fixed resolution for 5.0.0 and we can re-add it.
This commit is contained in:
Nik Everett 2016-10-28 10:29:29 -04:00
parent 9598616dfe
commit 9e3eacec35
1 changed files with 2 additions and 5 deletions

View File

@ -125,10 +125,7 @@ Set<String> getVersions() {
new URL('https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/maven-metadata.xml').openStream().withStream { s ->
xml = new XmlParser().parse(s)
}
// List all N-1 releases from maven central
int major = Integer.parseInt(project.version.substring(0, project.version.indexOf('.'))) - 1
Set<String> versions = new TreeSet<>(xml.versioning.versions.version.collect { it.text() }.findAll { it ==~ /$major\.\d\.\d/ })
Set<String> versions = new TreeSet<>(xml.versioning.versions.version.collect { it.text() }.findAll { it ==~ /[5]\.\d\.\d/ })
if (versions.isEmpty() == false) {
return versions;
}
@ -151,7 +148,7 @@ task verifyPackagingTestUpgradeFromVersions {
String maybeUpdateFromVersions = System.getProperty("tests.packaging.upgrade.from.versions", null)
if (maybeUpdateFromVersions == null) {
Set<String> versions = getVersions()
Set<String> actualVersions = new HashSet<>(Arrays.asList(upgradeFromVersions))
Set<String> actualVersions = new TreeSet<>(Arrays.asList(upgradeFromVersions))
if (!versions.equals(actualVersions)) {
println("out-of-date versions [" + actualVersions + "], expected [" + versions + "]; run gradle updatePackagingTestUpgradeFromVersions")
// throw new GradleException("out-of-date versions [" + actualVersions + "], expected [" + versions + "]; run gradle updatePackagingTestUpgradeFromVersions")