Skip to content

Commit

Permalink
packaging test use dir of jars rather than uberjar
Browse files Browse the repository at this point in the history
  • Loading branch information
andyb-elastic committed Apr 2, 2018
1 parent c5f1eb8 commit c16706d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class VagrantPropertiesExtension {
@Input
Boolean inheritTestUtils

@Input
String testMainClass

VagrantPropertiesExtension(List<String> availableBoxes) {
this.boxes = availableBoxes
this.batsDir = 'src/test/resources/packaging'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class VagrantTestPlugin implements Plugin<Project> {
environmentVars vagrantEnvVars
dependsOn up, setupPackagingTest
finalizedBy halt
args '--command', 'set -e; for jar in $PACKAGING_TESTS/*.jar; do java -jar $jar; done'
args '--command', "java -cp \"\$PACKAGING_TESTS/*\" ${-> project.extensions.esvagrant.testMainClass}"
}

TaskExecutionAdapter groovyPackagingReproListener = createReproListener(project, groovyPackagingTest.path)
Expand Down
18 changes: 8 additions & 10 deletions qa/vagrant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

plugins {
id 'groovy'
id 'application'
id 'com.github.johnrengelman.shadow' version '2.0.2'
id 'elasticsearch.build'
id 'elasticsearch.vagrantsupport'
id 'elasticsearch.vagrant'
Expand All @@ -29,14 +27,12 @@ plugins {
dependencies {
compile localGroovy()
compile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
runtime project(':libs:elasticsearch-core') // needs to be on the classpath for JarHell
packagingTest project(path: project.path, configuration: 'shadow')
}

shadowJar {
dependencies {
exclude(project(":libs:elasticsearch-core")) // isn't needed in tests
}
// needs to be on the classpath for JarHell but not actually needed for tests
runtime project(':libs:elasticsearch-core')

// pulls in the jar built by this project and its dependencies
packagingTest project(path: project.path, configuration: 'runtime')
}

List<String> plugins = []
Expand All @@ -59,7 +55,9 @@ setupPackagingTest {
}
}

mainClassName = 'org.elasticsearch.packaging.PackagingMain'
esvagrant {
testMainClass 'org.elasticsearch.packaging.PackagingMain'
}

tasks.test.enabled = false

Expand Down

0 comments on commit c16706d

Please sign in to comment.