File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change 1919
2020plugins {
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 {
2927dependencies {
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
4238List<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
6462tasks. test. enabled = false
6563
You can’t perform that action at this time.
0 commit comments