build.gradle 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. apply plugin: 'elasticsearch.standalone-rest-test'
  2. apply plugin: 'elasticsearch.rest-test'
  3. dependencies {
  4. // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here
  5. testCompile project(path: xpackModule('core'), configuration: 'default')
  6. testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
  7. testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
  8. }
  9. // bring in machine learning rest test suite
  10. task copyMlRestTests(type: Copy) {
  11. into project.sourceSets.test.output.resourcesDir
  12. from project(xpackProject('plugin').path).sourceSets.test.resources.srcDirs
  13. include 'rest-api-spec/test/ml/**'
  14. }
  15. integTestRunner {
  16. systemProperty 'tests.rest.blacklist', [
  17. // Remove this test because it doesn't call an ML endpoint and we don't want
  18. // to grant extra permissions to the users used in this test suite
  19. 'ml/ml_classic_analyze/Test analyze API with an analyzer that does what we used to do in native code',
  20. // Remove tests that are expected to throw an exception, because we cannot then
  21. // know whether to expect an authorization exception or a validation exception
  22. 'ml/calendar_crud/Test get calendar given missing',
  23. 'ml/calendar_crud/Test cannot create calendar with name _all',
  24. 'ml/calendar_crud/Test PageParams with ID is invalid',
  25. 'ml/calendar_crud/Test post calendar events given empty events',
  26. 'ml/calendar_crud/Test put calendar given id contains invalid chars',
  27. 'ml/calendar_crud/Test delete event from non existing calendar',
  28. 'ml/calendar_crud/Test delete job from non existing calendar',
  29. 'ml/custom_all_field/Test querying custom all field',
  30. 'ml/datafeeds_crud/Test delete datafeed with missing id',
  31. 'ml/datafeeds_crud/Test put datafeed referring to missing job_id',
  32. 'ml/datafeeds_crud/Test put datafeed with invalid query',
  33. 'ml/datafeeds_crud/Test put datafeed with security headers in the body',
  34. 'ml/datafeeds_crud/Test update datafeed with missing id',
  35. 'ml/delete_job_force/Test cannot force delete a non-existent job',
  36. 'ml/delete_model_snapshot/Test delete snapshot missing snapshotId',
  37. 'ml/delete_model_snapshot/Test delete snapshot missing job_id',
  38. 'ml/delete_model_snapshot/Test delete with in-use model',
  39. 'ml/filter_crud/Test create filter api with mismatching body ID',
  40. 'ml/filter_crud/Test create filter given invalid filter_id',
  41. 'ml/filter_crud/Test get filter API with bad ID',
  42. 'ml/filter_crud/Test invalid param combinations',
  43. 'ml/filter_crud/Test non-existing filter',
  44. 'ml/filter_crud/Test update filter given remove item is not present',
  45. 'ml/get_datafeed_stats/Test get datafeed stats given missing datafeed_id',
  46. 'ml/get_datafeeds/Test get datafeed given missing datafeed_id',
  47. 'ml/jobs_crud/Test cannot create job with existing categorizer state document',
  48. 'ml/jobs_crud/Test cannot create job with existing quantiles document',
  49. 'ml/jobs_crud/Test cannot create job with existing result document',
  50. 'ml/jobs_crud/Test cannot create job with model snapshot id set',
  51. 'ml/jobs_crud/Test cannot decrease model_memory_limit below current usage',
  52. 'ml/jobs_crud/Test get job API with non existing job id',
  53. 'ml/jobs_crud/Test put job after closing results index',
  54. 'ml/jobs_crud/Test put job after closing state index',
  55. 'ml/jobs_crud/Test put job with inconsistent body/param ids',
  56. 'ml/jobs_crud/Test put job with time field in analysis_config',
  57. 'ml/jobs_crud/Test job with categorization_analyzer and categorization_filters',
  58. 'ml/jobs_get/Test get job given missing job_id',
  59. 'ml/jobs_get_result_buckets/Test mutually-exclusive params',
  60. 'ml/jobs_get_result_buckets/Test mutually-exclusive params via body',
  61. 'ml/jobs_get_result_categories/Test with invalid param combinations',
  62. 'ml/jobs_get_result_categories/Test with invalid param combinations via body',
  63. 'ml/jobs_get_result_overall_buckets/Test overall buckets given missing job',
  64. 'ml/jobs_get_result_overall_buckets/Test overall buckets given non-matching expression and not allow_no_jobs',
  65. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is 0',
  66. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is negative',
  67. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid start param',
  68. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid end param',
  69. 'ml/jobs_get_result_overall_buckets/Test overall buckets given bucket_span is smaller than max job bucket_span',
  70. 'ml/jobs_get_stats/Test get job stats given missing job',
  71. 'ml/jobs_get_stats/Test no exception on get job stats with missing index',
  72. 'ml/job_groups/Test put job with empty group',
  73. 'ml/job_groups/Test put job with group that matches an job id',
  74. 'ml/job_groups/Test put job with group that matches its id',
  75. 'ml/job_groups/Test put job with id that matches an existing group',
  76. 'ml/job_groups/Test put job with invalid group',
  77. 'ml/ml_info/Test ml info',
  78. 'ml/post_data/Test Flush data with invalid parameters',
  79. 'ml/post_data/Test flushing and posting a closed job',
  80. 'ml/post_data/Test open and close with non-existent job id',
  81. 'ml/post_data/Test POST data with invalid parameters',
  82. 'ml/preview_datafeed/Test preview missing datafeed',
  83. 'ml/revert_model_snapshot/Test revert model with invalid snapshotId',
  84. 'ml/start_stop_datafeed/Test start datafeed job, but not open',
  85. 'ml/start_stop_datafeed/Test start non existing datafeed',
  86. 'ml/start_stop_datafeed/Test stop non existing datafeed',
  87. 'ml/update_model_snapshot/Test without description',
  88. 'ml/validate/Test invalid job config',
  89. 'ml/validate/Test job config is invalid because model snapshot id set',
  90. 'ml/validate/Test job config that is invalid only because of the job ID',
  91. 'ml/validate_detector/Test invalid detector'
  92. ].join(',')
  93. }
  94. integTestCluster {
  95. dependsOn copyMlRestTests
  96. extraConfigFile 'roles.yml', 'roles.yml'
  97. setupCommand 'setupTestAdminUser',
  98. 'bin/elasticsearch-users', 'useradd', 'x_pack_rest_user', '-p', 'x-pack-test-password', '-r', 'superuser'
  99. setupCommand 'setupMlAdminUser',
  100. 'bin/elasticsearch-users', 'useradd', 'ml_admin', '-p', 'x-pack-test-password', '-r', 'minimal,machine_learning_admin'
  101. setupCommand 'setupMlUserUser',
  102. 'bin/elasticsearch-users', 'useradd', 'ml_user', '-p', 'x-pack-test-password', '-r', 'minimal,machine_learning_user'
  103. setupCommand 'setupPowerlessUser',
  104. 'bin/elasticsearch-users', 'useradd', 'no_ml', '-p', 'x-pack-test-password', '-r', 'minimal'
  105. setting 'xpack.license.self_generated.type', 'trial'
  106. setting 'xpack.security.enabled', 'true'
  107. waitCondition = { node, ant ->
  108. File tmpFile = new File(node.cwd, 'wait.success')
  109. ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
  110. dest: tmpFile.toString(),
  111. username: 'x_pack_rest_user',
  112. password: 'x-pack-test-password',
  113. ignoreerrors: true,
  114. retries: 10)
  115. return tmpFile.exists()
  116. }
  117. }