2019-09-11 13:55:31 -04:00
|
|
|
|
2017-12-13 10:19:31 -05:00
|
|
|
dependencies {
|
2019-06-04 16:50:23 -04:00
|
|
|
testCompile project(':x-pack:plugin:core')
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Project mainProject = project
|
|
|
|
|
2018-07-19 02:46:58 -04:00
|
|
|
group = "${group}.x-pack.qa.sql.security"
|
|
|
|
|
2019-09-11 13:55:31 -04:00
|
|
|
configurations.create('testArtifacts')
|
|
|
|
|
|
|
|
TaskProvider testJar = tasks.register("testJar", Jar) {
|
|
|
|
appendix 'test'
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
testArtifacts testJar
|
|
|
|
}
|
|
|
|
|
2019-01-08 06:39:03 -05:00
|
|
|
// Tests are pushed down to subprojects and will be checked there.
|
2019-02-08 10:23:16 -05:00
|
|
|
testingConventions.enabled = false
|
2019-01-08 06:39:03 -05:00
|
|
|
|
2017-12-13 10:19:31 -05:00
|
|
|
subprojects {
|
2019-09-11 13:55:31 -04:00
|
|
|
// Use tests from the root security qa project in subprojects
|
|
|
|
configurations.create('testArtifacts')
|
2019-04-08 10:05:12 -04:00
|
|
|
|
2017-12-13 10:19:31 -05:00
|
|
|
dependencies {
|
2019-06-04 16:50:23 -04:00
|
|
|
testCompile project(":x-pack:plugin:core")
|
2019-09-11 13:55:31 -04:00
|
|
|
testArtifacts project(path: mainProject.path, configuration: 'testArtifacts')
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
testClusters.integTest {
|
2019-07-15 20:53:05 -04:00
|
|
|
testDistribution = 'DEFAULT'
|
2017-12-13 10:19:31 -05:00
|
|
|
// Setup auditing so we can use it in some tests
|
|
|
|
setting 'xpack.security.audit.enabled', 'true'
|
2018-03-21 23:09:44 -04:00
|
|
|
setting 'xpack.security.enabled', 'true'
|
2018-05-03 12:33:08 -04:00
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
2017-12-13 10:19:31 -05:00
|
|
|
// Setup roles used by tests
|
2019-06-20 02:21:29 -04:00
|
|
|
extraConfigFile 'roles.yml', mainProject.file('roles.yml')
|
2017-12-13 10:19:31 -05:00
|
|
|
/* Setup the one admin user that we run the tests as.
|
|
|
|
* Tests use "run as" to get different users. */
|
2019-06-20 02:21:29 -04:00
|
|
|
user username: "test_admin", password: "x-pack-test-password"
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
|
|
|
|
2019-09-11 13:55:31 -04:00
|
|
|
File testArtifactsDir = project.file("$buildDir/testArtifacts")
|
|
|
|
TaskProvider copyTestClasses = tasks.register("copyTestClasses", Copy) {
|
|
|
|
dependsOn configurations.testArtifacts
|
|
|
|
from { zipTree(configurations.testArtifacts.singleFile) }
|
|
|
|
into testArtifactsDir
|
|
|
|
}
|
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
integTest.runner {
|
2019-09-11 13:55:31 -04:00
|
|
|
dependsOn copyTestClasses
|
|
|
|
testClassesDirs += project.files(testArtifactsDir)
|
|
|
|
classpath += configurations.testArtifacts
|
2019-04-09 14:52:50 -04:00
|
|
|
nonInputProperties.systemProperty 'tests.audit.logfile',
|
2019-06-20 02:21:29 -04:00
|
|
|
"${ -> testClusters.integTest.singleNode().getAuditLog()}"
|
2019-04-09 14:52:50 -04:00
|
|
|
nonInputProperties.systemProperty 'tests.audit.yesterday.logfile',
|
2019-06-20 02:21:29 -04:00
|
|
|
"${ -> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json"
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|
2019-09-11 13:55:31 -04:00
|
|
|
|
|
|
|
testingConventions.enabled = false
|
2017-12-13 10:19:31 -05:00
|
|
|
}
|