From 2ffdd4468d8a2671a160278a3a94714e72347786 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 11 May 2017 15:32:31 -0400 Subject: [PATCH] Skip reindex tests from old es if we can't run it Two of the versions of Elasticsearch we need to run for these tests can't run in Java 9 so we skip the entire test if we are running in java 9. For now. I'd like to reenable it to run against java 8 if there is one available, but that can wait for another time. Relates to #24561 --- qa/reindex-from-old/build.gradle | 63 ++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/qa/reindex-from-old/build.gradle b/qa/reindex-from-old/build.gradle index ca05e691985..a87cea6112b 100644 --- a/qa/reindex-from-old/build.gradle +++ b/qa/reindex-from-old/build.gradle @@ -49,34 +49,41 @@ dependencies { es090 'org.elasticsearch:elasticsearch:0.90.13@zip' } -/* Set up tasks to unzip and run the old versions of ES before running the - * integration tests. */ -for (String version : ['2', '1', '090']) { - Task unzip = task("unzipEs${version}", type: Sync) { - Configuration oldEsDependency = configurations['es' + version] - dependsOn oldEsDependency - // Use a closure here to delay resolution of the dependency until we need it - from { - oldEsDependency.collect { zipTree(it) } +if (project.javaVersion == JavaVersion.VERSION_1_9) { + /* We can't run the dependencies with Java 9 so for now we'll skip the whole + * thing. */ + integTest.enabled = false +} else { + /* Set up tasks to unzip and run the old versions of ES before running the + * integration tests. */ + for (String version : ['2', '1', '090']) { + Task unzip = task("unzipEs${version}", type: Sync) { + Configuration oldEsDependency = configurations['es' + version] + dependsOn oldEsDependency + /* Use a closure here to delay resolution of the dependency until we need + * it */ + from { + oldEsDependency.collect { zipTree(it) } + } + into temporaryDir + } + Task fixture = task("oldEs${version}Fixture", + type: org.elasticsearch.gradle.test.AntFixture) { + dependsOn project.configurations.oldesFixture + dependsOn unzip + executable = new File(project.javaHome, 'bin/java') + env 'CLASSPATH', "${ -> project.configurations.oldesFixture.asPath }" + args 'oldes.OldElasticsearch', + baseDir, + unzip.temporaryDir, + version == '090' + } + integTest.dependsOn fixture + integTestRunner { + /* Use a closure on the string to delay evaluation until right before we + * run the integration tests so that we can be sure that the file is + * ready. */ + systemProperty "es${version}.port", "${ -> fixture.addressAndPort }" } - into temporaryDir - } - Task fixture = task("oldEs${version}Fixture", - type: org.elasticsearch.gradle.test.AntFixture) { - dependsOn project.configurations.oldesFixture - dependsOn unzip - executable = new File(project.javaHome, 'bin/java') - env 'CLASSPATH', "${ -> project.configurations.oldesFixture.asPath }" - args 'oldes.OldElasticsearch', - baseDir, - unzip.temporaryDir, - version == '090' - } - integTest.dependsOn fixture - integTestRunner { - /* Use a closure on the string to delay evaluation until right before we - * run the integration tests so that we can be sure that the file is ready. - */ - systemProperty "es${version}.port", "${ -> fixture.addressAndPort }" } }