Skip to content

Commit

Permalink
Use TestArtifact plugin instead of custom test jar tasks (#75931)
Browse files Browse the repository at this point in the history
Make use of test artifact plugin and avoid using custom test jars created manually.

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
breskeby and elasticmachine authored Aug 4, 2021
1 parent e87f05d commit 2d7d3bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
17 changes: 4 additions & 13 deletions x-pack/plugin/sql/qa/jdbc/security/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
import org.elasticsearch.gradle.internal.test.RestIntegTestTask

apply plugin: 'elasticsearch.internal-test-artifact'

dependencies {
testImplementation project(':x-pack:plugin:core')
}

Project mainProject = project

configurations.create('testArtifacts')

TaskProvider testJar = tasks.register("testJar", Jar) {
appendix 'test'
from sourceSets.test.output
}

artifacts {
testArtifacts testJar
}

subprojects {
// Use tests from the root security qa project in subprojects
configurations.create('testArtifacts')
configurations.create('testArtifacts').transitive(false)

dependencies {
testImplementation project(":x-pack:plugin:core")
testArtifacts project(path: mainProject.path, configuration: 'testArtifacts')
testArtifacts testArtifact(project(mainProject.path))
}

testClusters.all {
Expand Down
17 changes: 4 additions & 13 deletions x-pack/plugin/sql/qa/server/security/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
apply plugin: 'elasticsearch.internal-test-artifact'

dependencies {
testImplementation project(':x-pack:plugin:core')
}

Project mainProject = project

configurations.create('testArtifacts')

TaskProvider testJar = tasks.register("testJar", Jar) {
appendix 'test'
from sourceSets.test.output
}

artifacts {
testArtifacts testJar
}

// Tests are pushed down to subprojects and will be checked there.
tasks.named("testingConventions").configure { enabled = false }

subprojects {
// Use tests from the root security qa project in subprojects
configurations.create('testArtifacts')
configurations.create('testArtifacts').transitive(false)

dependencies {
testImplementation project(":x-pack:plugin:core")
testArtifacts project(path: mainProject.path, configuration: 'testArtifacts')
testArtifacts testArtifact(project(mainProject.path))
}

testClusters.matching { it.name == "integTest" }.configureEach {
Expand Down

0 comments on commit 2d7d3bd

Please sign in to comment.