2017-03-14 12:13:41 -04:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'runtime')
|
2017-04-20 04:13:04 -04:00
|
|
|
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
|
2017-03-14 12:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// bring in machine learning rest test suite
|
|
|
|
task copyMlRestTests(type: Copy) {
|
|
|
|
into project.sourceSets.test.output.resourcesDir
|
|
|
|
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources.srcDirs
|
|
|
|
include 'rest-api-spec/test/ml/**'
|
|
|
|
}
|
|
|
|
|
|
|
|
integTestRunner {
|
|
|
|
systemProperty 'tests.rest.blacklist', [
|
2018-01-11 10:40:13 -05:00
|
|
|
// Remove this test because it doesn't call an ML endpoint and we don't want
|
|
|
|
// to grant extra permissions to the users used in this test suite
|
|
|
|
'ml/ml_classic_analyze/Test analyze API with an analyzer that does what we used to do in native code',
|
2017-03-27 05:24:05 -04:00
|
|
|
// Remove tests that are expected to throw an exception, because we cannot then
|
|
|
|
// know whether to expect an authorization exception or a validation exception
|
2017-12-12 04:21:44 -05:00
|
|
|
'ml/calendar_crud/Test cannot create calendar with name _all',
|
|
|
|
'ml/calendar_crud/Test PageParams with ID is invalid',
|
2018-01-15 13:13:50 -05:00
|
|
|
'ml/calendar_crud/Test post calendar events given empty events',
|
2017-09-05 05:49:41 -04:00
|
|
|
'ml/custom_all_field/Test querying custom all field',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/datafeeds_crud/Test delete datafeed with missing id',
|
|
|
|
'ml/datafeeds_crud/Test put datafeed referring to missing job_id',
|
|
|
|
'ml/datafeeds_crud/Test put datafeed with invalid query',
|
|
|
|
'ml/datafeeds_crud/Test update datafeed with missing id',
|
2017-09-05 05:49:41 -04:00
|
|
|
'ml/delete_job_force/Test cannot force delete a non-existent job',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/delete_model_snapshot/Test delete snapshot missing snapshotId',
|
|
|
|
'ml/delete_model_snapshot/Test delete snapshot missing job_id',
|
|
|
|
'ml/delete_model_snapshot/Test delete with in-use model',
|
2017-05-18 13:09:20 -04:00
|
|
|
'ml/filter_crud/Test create filter api with mismatching body ID',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/filter_crud/Test get filter API with bad ID',
|
|
|
|
'ml/filter_crud/Test invalid param combinations',
|
|
|
|
'ml/filter_crud/Test non-existing filter',
|
|
|
|
'ml/get_datafeed_stats/Test get datafeed stats given missing datafeed_id',
|
|
|
|
'ml/get_datafeeds/Test get datafeed given missing datafeed_id',
|
2017-06-05 06:35:48 -04:00
|
|
|
'ml/jobs_crud/Test cannot create job with existing categorizer state document',
|
|
|
|
'ml/jobs_crud/Test cannot create job with existing quantiles document',
|
|
|
|
'ml/jobs_crud/Test cannot create job with existing result document',
|
2017-06-08 05:11:08 -04:00
|
|
|
'ml/jobs_crud/Test cannot create job with model snapshot id set',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/jobs_crud/Test get job API with non existing job id',
|
2017-08-07 03:53:12 -04:00
|
|
|
'ml/jobs_crud/Test put job after closing results index',
|
|
|
|
'ml/jobs_crud/Test put job after closing state index',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/jobs_crud/Test put job with inconsistent body/param ids',
|
2017-06-15 08:04:25 -04:00
|
|
|
'ml/jobs_crud/Test put job with time field in analysis_config',
|
2018-01-11 10:40:13 -05:00
|
|
|
'ml/jobs_crud/Test job with categorization_analyzer and categorization_filters',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/jobs_get/Test get job given missing job_id',
|
|
|
|
'ml/jobs_get_result_buckets/Test mutually-exclusive params',
|
|
|
|
'ml/jobs_get_result_buckets/Test mutually-exclusive params via body',
|
|
|
|
'ml/jobs_get_result_categories/Test with invalid param combinations',
|
|
|
|
'ml/jobs_get_result_categories/Test with invalid param combinations via body',
|
2017-10-10 09:41:24 -04:00
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given missing job',
|
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given non-matching expression and not allow_no_jobs',
|
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is 0',
|
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is negative',
|
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid start param',
|
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid end param',
|
2017-10-27 06:14:13 -04:00
|
|
|
'ml/jobs_get_result_overall_buckets/Test overall buckets given bucket_span is smaller than max job bucket_span',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/jobs_get_stats/Test get job stats given missing job',
|
2017-06-08 05:11:08 -04:00
|
|
|
'ml/jobs_get_stats/Test no exception on get job stats with missing index',
|
2017-09-05 05:49:41 -04:00
|
|
|
'ml/job_groups/Test put job with empty group',
|
|
|
|
'ml/job_groups/Test put job with group that matches an job id',
|
|
|
|
'ml/job_groups/Test put job with group that matches its id',
|
|
|
|
'ml/job_groups/Test put job with id that matches an existing group',
|
|
|
|
'ml/job_groups/Test put job with invalid group',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/post_data/Test Flush data with invalid parameters',
|
2017-05-08 11:34:46 -04:00
|
|
|
'ml/post_data/Test flushing and posting a closed job',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/post_data/Test open and close with non-existent job id',
|
|
|
|
'ml/post_data/Test POST data with invalid parameters',
|
|
|
|
'ml/preview_datafeed/Test preview missing datafeed',
|
|
|
|
'ml/revert_model_snapshot/Test revert model with invalid snapshotId',
|
|
|
|
'ml/start_stop_datafeed/Test start datafeed job, but not open',
|
|
|
|
'ml/start_stop_datafeed/Test start non existing datafeed',
|
|
|
|
'ml/start_stop_datafeed/Test stop non existing datafeed',
|
|
|
|
'ml/update_model_snapshot/Test without description',
|
|
|
|
'ml/validate/Test invalid job config',
|
2017-06-07 04:34:58 -04:00
|
|
|
'ml/validate/Test job config is invalid because model snapshot id set',
|
2017-06-08 05:11:08 -04:00
|
|
|
'ml/validate/Test job config that is invalid only because of the job ID',
|
2017-03-14 12:13:41 -04:00
|
|
|
'ml/validate_detector/Test invalid detector'
|
|
|
|
].join(',')
|
|
|
|
}
|
|
|
|
|
|
|
|
integTestCluster {
|
2017-04-17 19:04:09 -04:00
|
|
|
dependsOn copyMlRestTests
|
2017-03-14 12:13:41 -04:00
|
|
|
plugin ':x-pack-elasticsearch:plugin'
|
|
|
|
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
|
|
|
|
setupCommand 'setupTestAdminUser',
|
2017-09-05 05:49:41 -04:00
|
|
|
'bin/x-pack/users', 'useradd', 'x_pack_rest_user', '-p', 'x-pack-test-password', '-r', 'superuser'
|
2017-03-14 12:13:41 -04:00
|
|
|
setupCommand 'setupMlAdminUser',
|
2017-06-29 16:27:57 -04:00
|
|
|
'bin/x-pack/users', 'useradd', 'ml_admin', '-p', 'x-pack-test-password', '-r', 'minimal,machine_learning_admin'
|
2017-03-14 12:13:41 -04:00
|
|
|
setupCommand 'setupMlUserUser',
|
2017-06-29 16:27:57 -04:00
|
|
|
'bin/x-pack/users', 'useradd', 'ml_user', '-p', 'x-pack-test-password', '-r', 'minimal,machine_learning_user'
|
2017-03-14 12:13:41 -04:00
|
|
|
setupCommand 'setupPowerlessUser',
|
2017-06-29 16:27:57 -04:00
|
|
|
'bin/x-pack/users', 'useradd', 'no_ml', '-p', 'x-pack-test-password', '-r', 'minimal'
|
2017-03-14 12:13:41 -04:00
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
2017-03-15 13:27:38 -04:00
|
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
2017-03-14 12:13:41 -04:00
|
|
|
dest: tmpFile.toString(),
|
2017-09-05 05:49:41 -04:00
|
|
|
username: 'x_pack_rest_user',
|
2017-06-29 16:27:57 -04:00
|
|
|
password: 'x-pack-test-password',
|
2017-03-14 12:13:41 -04:00
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
|
|
|
}
|