mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-13 08:25:26 +00:00
Move the JDBC functionality integration tests from `:sql:qa` to a separate module `:sql:qa:jdbc`. This way the tests are isolated from the rest of the integration tests and they only depend to the `:sql:jdbc` module, thus removing the danger of accidentally pulling in some dependency that may hide bugs. Moreover this is a preparation for #56722, so that we can run those tests between different JDBC and ES node versions and ensure forward compatibility. Move the rest of existing tests inside a new `:sql:qa:server` project, so that the `:sql:qa` becomes the parent project for both and one can run all the integration tests by using this parent project. (cherry picked from commit c09f4a04484b8a43934fe58fbc41bd90b7dbcc76)
62 lines
2.0 KiB
Groovy
62 lines
2.0 KiB
Groovy
dependencies {
|
|
testCompile 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.
|
|
testingConventions.enabled = false
|
|
|
|
subprojects {
|
|
// Use tests from the root security qa project in subprojects
|
|
configurations.create('testArtifacts')
|
|
|
|
dependencies {
|
|
testCompile project(":x-pack:plugin:core")
|
|
testArtifacts project(path: mainProject.path, configuration: 'testArtifacts')
|
|
}
|
|
|
|
testClusters.integTest {
|
|
testDistribution = 'DEFAULT'
|
|
// Setup auditing so we can use it in some tests
|
|
setting 'xpack.security.audit.enabled', 'true'
|
|
setting 'xpack.security.enabled', 'true'
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
// Setup roles used by tests
|
|
extraConfigFile 'roles.yml', mainProject.file('roles.yml')
|
|
/* Setup the one admin user that we run the tests as.
|
|
* Tests use "run as" to get different users. */
|
|
user username: "test_admin", password: "x-pack-test-password"
|
|
}
|
|
|
|
File testArtifactsDir = project.file("$buildDir/testArtifacts")
|
|
TaskProvider copyTestClasses = tasks.register("copyTestClasses", Copy) {
|
|
dependsOn configurations.testArtifacts
|
|
from { zipTree(configurations.testArtifacts.singleFile) }
|
|
into testArtifactsDir
|
|
}
|
|
|
|
integTest.runner {
|
|
dependsOn copyTestClasses
|
|
testClassesDirs += project.files(testArtifactsDir)
|
|
classpath += configurations.testArtifacts
|
|
nonInputProperties.systemProperty 'tests.audit.logfile',
|
|
"${-> testClusters.integTest.singleNode().getAuditLog()}"
|
|
nonInputProperties.systemProperty 'tests.audit.yesterday.logfile',
|
|
"${-> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json"
|
|
}
|
|
|
|
testingConventions.enabled = false
|
|
}
|