apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'runtime') testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts') } // 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', [ // Remove tests that are expected to throw an exception, because we cannot then // know whether to expect an authorization exception or a validation exception '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', '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', 'ml/filter_crud/Test create filter api without ID', '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', 'ml/jobs_crud/Test get job API with non existing job id', 'ml/jobs_crud/Test put job with inconsistent body/param ids', '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', 'ml/jobs_get_stats/Test get job stats given missing job', 'ml/post_data/Test Flush data with invalid parameters', 'ml/post_data/Test flushing, posting and closing a closed job', '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 already stopped datafeed job', 'ml/start_stop_datafeed/Test stop non existing datafeed', 'ml/update_model_snapshot/Test without description', 'ml/validate/Test invalid job config', 'ml/validate/Test job config that is invalid only because of the job ID', 'ml/validate_detector/Test invalid detector' ].join(',') } integTestCluster { dependsOn copyMlRestTests plugin ':x-pack-elasticsearch:plugin' extraConfigFile 'x-pack/roles.yml', 'roles.yml' setupCommand 'setupTestAdminUser', 'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'superuser' setupCommand 'setupMlAdminUser', 'bin/x-pack/users', 'useradd', 'ml_admin', '-p', 'changeme', '-r', 'minimal,machine_learning_admin' setupCommand 'setupMlUserUser', 'bin/x-pack/users', 'useradd', 'ml_user', '-p', 'changeme', '-r', 'minimal,machine_learning_user' setupCommand 'setupPowerlessUser', 'bin/x-pack/users', 'useradd', 'no_ml', '-p', 'changeme', '-r', 'minimal' 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: 'test_admin', password: 'changeme', ignoreerrors: true, retries: 10) return tmpFile.exists() } }