Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reuse of sql test code explicit #45884

Merged
merged 15 commits into from
Sep 11, 2019
3 changes: 3 additions & 0 deletions x-pack/plugin/sql/qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ forbiddenApisMain {
thirdPartyAudit.enabled = false

subprojects {
if (subprojects.isEmpty() == false) {
return // not a leaf project
}
apply plugin: 'elasticsearch.standalone-rest-test'
dependencies {

Expand Down
29 changes: 15 additions & 14 deletions x-pack/plugin/sql/qa/security/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

apply plugin: 'elasticsearch.build'

dependencies {
testCompile project(':x-pack:plugin:core')
}
Expand All @@ -6,27 +9,23 @@ Project mainProject = project

group = "${group}.x-pack.qa.sql.security"

configurations.create('testClasses')

String classesDir = project.file(project.sourceSets.main.output.classesDirs.singleFile).toString()
artifacts.add('testClasses', project.layout.projectDirectory.dir(classesDir)) {
builtBy tasks.named('testClasses')
mark-vieira marked this conversation as resolved.
Show resolved Hide resolved
}

// Tests are pushed down to subprojects and will be checked there.
testingConventions.enabled = false

subprojects {
// Use resources from the parent project in subprojects
sourceSets {
test {
mainProject.sourceSets.test.output.classesDirs.each { dir ->
output.addClassesDir { dir }
output.builtBy(mainProject.tasks.testClasses)
}
runtimeClasspath += mainProject.sourceSets.test.output
}
}

processTestResources {
from mainProject.file('src/test/resources')
}
// Use tests from the root security qa project in subprojects
configurations.create('testClasses')

dependencies {
testCompile project(":x-pack:plugin:core")
testClasses project(path: mainProject.path, configuration: 'testClasses')
}

testClusters.integTest {
Expand All @@ -43,6 +42,8 @@ subprojects {
}

integTest.runner {
dependsOn configurations.testClasses
mark-vieira marked this conversation as resolved.
Show resolved Hide resolved
testClassesDirs += project.files(configurations.testClasses.singleFile)
mark-vieira marked this conversation as resolved.
Show resolved Hide resolved
nonInputProperties.systemProperty 'tests.audit.logfile',
"${ -> testClusters.integTest.singleNode().getAuditLog()}"
nonInputProperties.systemProperty 'tests.audit.yesterday.logfile',
Expand Down