Skip to content

Commit c16706d

Browse files
committed
packaging test use dir of jars rather than uberjar
1 parent c5f1eb8 commit c16706d

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantPropertiesExtension.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class VagrantPropertiesExtension {
4040
@Input
4141
Boolean inheritTestUtils
4242

43+
@Input
44+
String testMainClass
45+
4346
VagrantPropertiesExtension(List<String> availableBoxes) {
4447
this.boxes = availableBoxes
4548
this.batsDir = 'src/test/resources/packaging'

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class VagrantTestPlugin implements Plugin<Project> {
389389
environmentVars vagrantEnvVars
390390
dependsOn up, setupPackagingTest
391391
finalizedBy halt
392-
args '--command', 'set -e; for jar in $PACKAGING_TESTS/*.jar; do java -jar $jar; done'
392+
args '--command', "java -cp \"\$PACKAGING_TESTS/*\" ${-> project.extensions.esvagrant.testMainClass}"
393393
}
394394

395395
TaskExecutionAdapter groovyPackagingReproListener = createReproListener(project, groovyPackagingTest.path)

qa/vagrant/build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
plugins {
2121
id 'groovy'
22-
id 'application'
23-
id 'com.github.johnrengelman.shadow' version '2.0.2'
2422
id 'elasticsearch.build'
2523
id 'elasticsearch.vagrantsupport'
2624
id 'elasticsearch.vagrant'
@@ -29,14 +27,12 @@ plugins {
2927
dependencies {
3028
compile localGroovy()
3129
compile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
32-
runtime project(':libs:elasticsearch-core') // needs to be on the classpath for JarHell
33-
packagingTest project(path: project.path, configuration: 'shadow')
34-
}
3530

36-
shadowJar {
37-
dependencies {
38-
exclude(project(":libs:elasticsearch-core")) // isn't needed in tests
39-
}
31+
// needs to be on the classpath for JarHell but not actually needed for tests
32+
runtime project(':libs:elasticsearch-core')
33+
34+
// pulls in the jar built by this project and its dependencies
35+
packagingTest project(path: project.path, configuration: 'runtime')
4036
}
4137

4238
List<String> plugins = []
@@ -59,7 +55,9 @@ setupPackagingTest {
5955
}
6056
}
6157

62-
mainClassName = 'org.elasticsearch.packaging.PackagingMain'
58+
esvagrant {
59+
testMainClass 'org.elasticsearch.packaging.PackagingMain'
60+
}
6361

6462
tasks.test.enabled = false
6563

0 commit comments

Comments
 (0)