cleanup ILM qa structure (#35110)
This commit does a few things - moves ILM-specifc rest yaml tests into plugin/ilm/qa, and creates special :plugin:ilm:qa:rest module to test them - removes the with-security tests of the yaml tests since they are covered in the rest tests now - moves ChangePolicyforIndexIT into the qa/multi-node project since that test is not currently running in main ilm since integTest is disabled
This commit is contained in:
parent
a294a7c6b5
commit
5f4b23f8c1
|
@ -18,8 +18,14 @@ dependencies {
|
||||||
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
||||||
}
|
}
|
||||||
|
|
||||||
check.dependsOn 'qa:with-security:integTestRunner'
|
// add all sub-projects of the qa sub-project
|
||||||
check.dependsOn 'qa:multi-node:integTestRunner'
|
gradle.projectsEvaluated {
|
||||||
|
project.subprojects
|
||||||
|
.find { it.path == project.path + ":qa" }
|
||||||
|
.subprojects
|
||||||
|
.findAll { it.path.startsWith(project.path + ":qa") }
|
||||||
|
.each { check.dependsOn it.check }
|
||||||
|
}
|
||||||
|
|
||||||
integTest.enabled = false
|
integTest.enabled = false
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
||||||
|
|
||||||
|
apply plugin: 'elasticsearch.build'
|
||||||
|
test.enabled = false
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':test:framework')
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
project.tasks.withType(RestIntegTestTask) {
|
||||||
|
final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources')
|
||||||
|
project.copyRestSpec.from(xPackResources) {
|
||||||
|
include 'rest-api-spec/api/**'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove assemble on all qa projects because we don't need to publish
|
/* Remove assemble on all qa projects because we don't need to publish
|
||||||
* artifacts for them. */
|
* artifacts for them. */
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
|
@ -9,3 +27,5 @@ gradle.projectsEvaluated {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the qa modules does not have any source files
|
||||||
|
licenseHeaders.enabled = false
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
||||||
|
|
||||||
|
apply plugin: 'elasticsearch.standalone-test'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
||||||
|
testCompile project(path: xpackModule('ilm'), configuration: 'runtime')
|
||||||
|
}
|
||||||
|
|
||||||
|
task restTest(type: RestIntegTestTask) {
|
||||||
|
mustRunAfter(precommit)
|
||||||
|
}
|
||||||
|
|
||||||
|
def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'),
|
||||||
|
password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')]
|
||||||
|
|
||||||
|
|
||||||
|
restTestRunner {
|
||||||
|
systemProperty 'tests.rest.cluster.username', clusterCredentials.username
|
||||||
|
systemProperty 'tests.rest.cluster.password', clusterCredentials.password
|
||||||
|
}
|
||||||
|
|
||||||
|
restTestCluster {
|
||||||
|
distribution 'zip'
|
||||||
|
setting 'xpack.ilm.enabled', 'true'
|
||||||
|
setting 'xpack.ml.enabled', 'false'
|
||||||
|
setting 'xpack.monitoring.enabled', 'false'
|
||||||
|
setting 'xpack.security.enabled', 'true'
|
||||||
|
setting 'xpack.license.self_generated.type', 'trial'
|
||||||
|
setupCommand 'setup-admin-user',
|
||||||
|
'bin/elasticsearch-users', 'useradd', clusterCredentials.username, '-p', clusterCredentials.password, '-r', 'superuser'
|
||||||
|
waitCondition = { node, ant ->
|
||||||
|
File tmpFile = new File(node.cwd, 'wait.success')
|
||||||
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
||||||
|
dest: tmpFile.toString(),
|
||||||
|
username: clusterCredentials.username,
|
||||||
|
password: clusterCredentials.password,
|
||||||
|
ignoreerrors: true,
|
||||||
|
retries: 10)
|
||||||
|
return tmpFile.exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
check.dependsOn restTest
|
||||||
|
test.enabled = false
|
|
@ -4,7 +4,7 @@
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.elasticsearch.xpack.security;
|
package org.elasticsearch.xpack.indexlifecycle;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||||
|
@ -21,12 +21,12 @@ import java.util.Objects;
|
||||||
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
|
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
|
||||||
|
|
||||||
@TimeoutSuite(millis = 30 * TimeUnits.MINUTE) // as default timeout seems not enough on the jenkins VMs
|
@TimeoutSuite(millis = 30 * TimeUnits.MINUTE) // as default timeout seems not enough on the jenkins VMs
|
||||||
public class IndexLifecycleWithSecurityClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
|
public class IndexLifecycleRestIT extends ESClientYamlSuiteTestCase {
|
||||||
|
|
||||||
private static final String USER = Objects.requireNonNull(System.getProperty("tests.rest.cluster.username"));
|
private static final String USER = Objects.requireNonNull(System.getProperty("tests.rest.cluster.username"));
|
||||||
private static final String PASS = Objects.requireNonNull(System.getProperty("tests.rest.cluster.password"));
|
private static final String PASS = Objects.requireNonNull(System.getProperty("tests.rest.cluster.password"));
|
||||||
|
|
||||||
public IndexLifecycleWithSecurityClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
|
public IndexLifecycleRestIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
|
||||||
super(testCandidate);
|
super(testCandidate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,6 @@ dependencies {
|
||||||
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
|
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
|
||||||
}
|
}
|
||||||
|
|
||||||
// bring in ILM rest test suite
|
|
||||||
task copyILMRestTests(type: Copy) {
|
|
||||||
into project.sourceSets.test.output.resourcesDir
|
|
||||||
from xpackProject('plugin').sourceSets.test.resources.srcDirs
|
|
||||||
include 'rest-api-spec/api/ilm.*'
|
|
||||||
include 'rest-api-spec/test/ilm/**'
|
|
||||||
}
|
|
||||||
|
|
||||||
def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'),
|
def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'),
|
||||||
password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')]
|
password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')]
|
||||||
|
|
||||||
|
@ -22,7 +14,6 @@ integTestRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
integTestCluster {
|
integTestCluster {
|
||||||
dependsOn copyILMRestTests
|
|
||||||
setting 'xpack.ilm.enabled', 'true'
|
setting 'xpack.ilm.enabled', 'true'
|
||||||
setting 'xpack.security.enabled', 'true'
|
setting 'xpack.security.enabled', 'true'
|
||||||
setting 'xpack.watcher.enabled', 'false'
|
setting 'xpack.watcher.enabled', 'false'
|
||||||
|
|
Loading…
Reference in New Issue