build.gradle 7.6 KB

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