build.gradle 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. apply plugin: 'elasticsearch.testclusters'
  2. apply plugin: 'elasticsearch.standalone-rest-test'
  3. apply plugin: 'elasticsearch.rest-test'
  4. dependencies {
  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. integTest.runner {
  16. dependsOn copyMlRestTests
  17. }
  18. integTest.runner {
  19. systemProperty 'tests.rest.blacklist', [
  20. // Remove this test because it doesn't call an ML endpoint and we don't want
  21. // to grant extra permissions to the users used in this test suite
  22. 'ml/ml_classic_analyze/Test analyze API with an analyzer that does what we used to do in native code',
  23. // Remove tests that are expected to throw an exception, because we cannot then
  24. // know whether to expect an authorization exception or a validation exception
  25. 'ml/calendar_crud/Test get calendar given missing',
  26. 'ml/calendar_crud/Test cannot create calendar with name _all',
  27. 'ml/calendar_crud/Test PageParams with ID is invalid',
  28. 'ml/calendar_crud/Test post calendar events given empty events',
  29. 'ml/calendar_crud/Test put calendar given id contains invalid chars',
  30. 'ml/calendar_crud/Test delete event from non existing calendar',
  31. 'ml/calendar_crud/Test delete job from non existing calendar',
  32. 'ml/custom_all_field/Test querying custom all field',
  33. 'ml/datafeeds_crud/Test delete datafeed with missing id',
  34. 'ml/datafeeds_crud/Test put datafeed referring to missing job_id',
  35. 'ml/datafeeds_crud/Test put datafeed with invalid query',
  36. 'ml/datafeeds_crud/Test put datafeed with security headers in the body',
  37. 'ml/datafeeds_crud/Test update datafeed with missing id',
  38. 'ml/data_frame_analytics_crud/Test put config with security headers in the body',
  39. 'ml/data_frame_analytics_crud/Test put config with create_time in the body',
  40. 'ml/data_frame_analytics_crud/Test put config with version in the body',
  41. 'ml/data_frame_analytics_crud/Test put config with inconsistent body/param ids',
  42. 'ml/data_frame_analytics_crud/Test put config with invalid id',
  43. 'ml/data_frame_analytics_crud/Test put config with invalid dest index name',
  44. 'ml/data_frame_analytics_crud/Test put config with pattern dest index name',
  45. 'ml/data_frame_analytics_crud/Test put config with missing concrete source index',
  46. 'ml/data_frame_analytics_crud/Test put config with missing wildcard source index',
  47. 'ml/data_frame_analytics_crud/Test put config with dest index same as source index',
  48. 'ml/data_frame_analytics_crud/Test put config with dest index matching multiple indices',
  49. 'ml/data_frame_analytics_crud/Test put config with dest index included in source via alias',
  50. 'ml/data_frame_analytics_crud/Test put config with unknown top level field',
  51. 'ml/data_frame_analytics_crud/Test put config with unknown field in outlier detection analysis',
  52. 'ml/data_frame_analytics_crud/Test put config given analyzed_fields include field excluded by source',
  53. 'ml/data_frame_analytics_crud/Test put config given missing source',
  54. 'ml/data_frame_analytics_crud/Test put config given source with empty index array',
  55. 'ml/data_frame_analytics_crud/Test put config given source with empty string in index array',
  56. 'ml/data_frame_analytics_crud/Test put config given source without index',
  57. 'ml/data_frame_analytics_crud/Test put config given missing dest',
  58. 'ml/data_frame_analytics_crud/Test put config given dest with empty index',
  59. 'ml/data_frame_analytics_crud/Test put config given dest without index',
  60. 'ml/data_frame_analytics_crud/Test put config given missing analysis',
  61. 'ml/data_frame_analytics_crud/Test put config given empty analysis',
  62. 'ml/data_frame_analytics_crud/Test max model memory limit',
  63. 'ml/data_frame_analytics_crud/Test put outlier_detection given n_neighbors is negative',
  64. 'ml/data_frame_analytics_crud/Test put outlier_detection given n_neighbors is zero',
  65. 'ml/data_frame_analytics_crud/Test put outlier_detection given feature_influence_threshold is negative',
  66. 'ml/data_frame_analytics_crud/Test put outlier_detection given feature_influence_threshold is greater than one',
  67. 'ml/data_frame_analytics_crud/Test put outlier_detection given outlier_fraction is negative',
  68. 'ml/data_frame_analytics_crud/Test put outlier_detection given outlier_fraction is greater than one',
  69. 'ml/data_frame_analytics_crud/Test put regression given dependent_variable is not defined',
  70. 'ml/data_frame_analytics_crud/Test put regression given negative lambda',
  71. 'ml/data_frame_analytics_crud/Test put regression given negative gamma',
  72. 'ml/data_frame_analytics_crud/Test put regression given eta less than 1e-3',
  73. 'ml/data_frame_analytics_crud/Test put regression given eta greater than one',
  74. 'ml/data_frame_analytics_crud/Test put regression given maximum_number_trees is zero',
  75. 'ml/data_frame_analytics_crud/Test put regression given maximum_number_trees is greater than 2k',
  76. 'ml/data_frame_analytics_crud/Test put regression given feature_bag_fraction is negative',
  77. 'ml/data_frame_analytics_crud/Test put regression given feature_bag_fraction is greater than one',
  78. 'ml/data_frame_analytics_crud/Test put regression given training_percent is less than one',
  79. 'ml/data_frame_analytics_crud/Test put regression given training_percent is greater than hundred',
  80. 'ml/data_frame_analytics_crud/Test put classification given dependent_variable is not defined',
  81. 'ml/data_frame_analytics_crud/Test put classification given negative lambda',
  82. 'ml/data_frame_analytics_crud/Test put classification given negative gamma',
  83. 'ml/data_frame_analytics_crud/Test put classification given eta less than 1e-3',
  84. 'ml/data_frame_analytics_crud/Test put classification given eta greater than one',
  85. 'ml/data_frame_analytics_crud/Test put classification given maximum_number_trees is zero',
  86. 'ml/data_frame_analytics_crud/Test put classification given maximum_number_trees is greater than 2k',
  87. 'ml/data_frame_analytics_crud/Test put classification given feature_bag_fraction is negative',
  88. 'ml/data_frame_analytics_crud/Test put classification given feature_bag_fraction is greater than one',
  89. 'ml/data_frame_analytics_crud/Test put classification given num_top_classes is less than zero',
  90. 'ml/data_frame_analytics_crud/Test put classification given num_top_classes is greater than 1k',
  91. 'ml/data_frame_analytics_crud/Test put classification given training_percent is less than one',
  92. 'ml/data_frame_analytics_crud/Test put classification given training_percent is greater than hundred',
  93. 'ml/evaluate_data_frame/Test given missing index',
  94. 'ml/evaluate_data_frame/Test given index does not exist',
  95. 'ml/evaluate_data_frame/Test given missing evaluation',
  96. 'ml/evaluate_data_frame/Test binary_soft_classification auc_roc given actual_field is always true',
  97. 'ml/evaluate_data_frame/Test binary_soft_classification auc_roc given actual_field is always false',
  98. 'ml/evaluate_data_frame/Test binary_soft_classification given evaluation with empty metrics',
  99. 'ml/evaluate_data_frame/Test binary_soft_classification given missing actual_field',
  100. 'ml/evaluate_data_frame/Test binary_soft_classification given missing predicted_probability_field',
  101. 'ml/evaluate_data_frame/Test binary_soft_classification given precision with threshold less than zero',
  102. 'ml/evaluate_data_frame/Test binary_soft_classification given recall with threshold less than zero',
  103. 'ml/evaluate_data_frame/Test binary_soft_classification given confusion_matrix with threshold less than zero',
  104. 'ml/evaluate_data_frame/Test binary_soft_classification given precision with empty thresholds',
  105. 'ml/evaluate_data_frame/Test binary_soft_classification given recall with empty thresholds',
  106. 'ml/evaluate_data_frame/Test binary_soft_classification given confusion_matrix with empty thresholds',
  107. 'ml/evaluate_data_frame/Test classification given evaluation with empty metrics',
  108. 'ml/evaluate_data_frame/Test classification given missing actual_field',
  109. 'ml/evaluate_data_frame/Test classification given missing predicted_field',
  110. 'ml/evaluate_data_frame/Test regression given evaluation with empty metrics',
  111. 'ml/evaluate_data_frame/Test regression given missing actual_field',
  112. 'ml/evaluate_data_frame/Test regression given missing predicted_field',
  113. 'ml/explain_data_frame_analytics/Test neither job id nor body',
  114. 'ml/explain_data_frame_analytics/Test both job id and body',
  115. 'ml/explain_data_frame_analytics/Test missing job',
  116. 'ml/explain_data_frame_analytics/Test empty data frame given body',
  117. 'ml/delete_job_force/Test cannot force delete a non-existent job',
  118. 'ml/delete_model_snapshot/Test delete snapshot missing snapshotId',
  119. 'ml/delete_model_snapshot/Test delete snapshot missing job_id',
  120. 'ml/delete_model_snapshot/Test delete with in-use model',
  121. 'ml/filter_crud/Test create filter api with mismatching body ID',
  122. 'ml/filter_crud/Test create filter given invalid filter_id',
  123. 'ml/filter_crud/Test get filter API with bad ID',
  124. 'ml/filter_crud/Test invalid param combinations',
  125. 'ml/filter_crud/Test non-existing filter',
  126. 'ml/filter_crud/Test update filter given remove item is not present',
  127. 'ml/filter_crud/Test get all filter given index exists but no mapping for filter_id',
  128. 'ml/get_datafeed_stats/Test get datafeed stats given missing datafeed_id',
  129. 'ml/get_datafeeds/Test get datafeed given missing datafeed_id',
  130. 'ml/inference_crud/Test delete given used trained model',
  131. 'ml/inference_crud/Test delete given unused trained model',
  132. 'ml/inference_crud/Test delete with missing model',
  133. 'ml/inference_crud/Test get given missing trained model',
  134. 'ml/inference_crud/Test get given expression without matches and allow_no_match is false',
  135. 'ml/inference_stats_crud/Test get stats given missing trained model',
  136. 'ml/inference_stats_crud/Test get stats given expression without matches and allow_no_match is false',
  137. 'ml/jobs_crud/Test cannot create job with existing categorizer state document',
  138. 'ml/jobs_crud/Test cannot create job with existing quantiles document',
  139. 'ml/jobs_crud/Test cannot create job with existing result document',
  140. 'ml/jobs_crud/Test cannot create job with model snapshot id set',
  141. 'ml/jobs_crud/Test cannot decrease model_memory_limit below current usage',
  142. 'ml/jobs_crud/Test get job API with non existing job id',
  143. 'ml/jobs_crud/Test put job after closing results index',
  144. 'ml/jobs_crud/Test put job after closing state index',
  145. 'ml/jobs_crud/Test put job with inconsistent body/param ids',
  146. 'ml/jobs_crud/Test put job with time field in analysis_config',
  147. 'ml/jobs_crud/Test put job with duplicate detector configurations',
  148. 'ml/jobs_crud/Test job with categorization_analyzer and categorization_filters',
  149. 'ml/jobs_get/Test get job given missing job_id',
  150. 'ml/jobs_get_result_buckets/Test mutually-exclusive params',
  151. 'ml/jobs_get_result_buckets/Test mutually-exclusive params via body',
  152. 'ml/jobs_get_result_categories/Test with invalid param combinations',
  153. 'ml/jobs_get_result_categories/Test with invalid param combinations via body',
  154. 'ml/jobs_get_result_overall_buckets/Test overall buckets given missing job',
  155. 'ml/jobs_get_result_overall_buckets/Test overall buckets given non-matching expression and not allow_no_jobs',
  156. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is 0',
  157. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is negative',
  158. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid start param',
  159. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid end param',
  160. 'ml/jobs_get_result_overall_buckets/Test overall buckets given bucket_span is smaller than max job bucket_span',
  161. 'ml/jobs_get_stats/Test get job stats given missing job',
  162. 'ml/jobs_get_stats/Test no exception on get job stats with missing index',
  163. 'ml/job_groups/Test put job with empty group',
  164. 'ml/job_groups/Test put job with group that matches an job id',
  165. 'ml/job_groups/Test put job with group that matches its id',
  166. 'ml/job_groups/Test put job with id that matches an existing group',
  167. 'ml/job_groups/Test put job with invalid group',
  168. 'ml/ml_info/Test ml info',
  169. 'ml/post_data/Test Flush data with invalid parameters',
  170. 'ml/post_data/Test flushing and posting a closed job',
  171. 'ml/post_data/Test open and close with non-existent job id',
  172. 'ml/post_data/Test POST data with invalid parameters',
  173. 'ml/preview_datafeed/Test preview missing datafeed',
  174. 'ml/revert_model_snapshot/Test revert model with invalid snapshotId',
  175. 'ml/start_data_frame_analytics/Test start given missing source index',
  176. 'ml/start_data_frame_analytics/Test start given source index has no compatible fields',
  177. 'ml/start_data_frame_analytics/Test start with inconsistent body/param ids',
  178. 'ml/start_data_frame_analytics/Test start given dest index is not empty',
  179. 'ml/start_data_frame_analytics/Test start with compatible fields but no data',
  180. 'ml/start_stop_datafeed/Test start datafeed job, but not open',
  181. 'ml/start_stop_datafeed/Test start non existing datafeed',
  182. 'ml/start_stop_datafeed/Test stop non existing datafeed',
  183. 'ml/update_model_snapshot/Test without description',
  184. 'ml/validate/Test invalid job config',
  185. 'ml/validate/Test job config is invalid because model snapshot id set',
  186. 'ml/validate/Test job config that is invalid only because of the job ID',
  187. 'ml/validate/Test job config with duplicate detector configurations',
  188. 'ml/validate_detector/Test invalid detector',
  189. 'ml/delete_forecast/Test delete on _all forecasts not allow no forecasts',
  190. 'ml/delete_forecast/Test delete forecast on missing forecast',
  191. 'ml/set_upgrade_mode/Attempt to open job when upgrade_mode is enabled',
  192. 'ml/set_upgrade_mode/Setting upgrade_mode to enabled',
  193. 'ml/set_upgrade_mode/Setting upgrade mode to disabled from enabled',
  194. 'ml/set_upgrade_mode/Test setting upgrade_mode to false when it is already false'
  195. ].join(',')
  196. }
  197. testClusters.integTest {
  198. testDistribution = 'DEFAULT'
  199. extraConfigFile 'roles.yml', file('roles.yml')
  200. user username: "x_pack_rest_user", password: "x-pack-test-password"
  201. user username: "ml_admin", password: "x-pack-test-password", role: "minimal,machine_learning_admin"
  202. user username: "ml_user", password: "x-pack-test-password", role: "minimal,machine_learning_user"
  203. user username: "no_ml", password: "x-pack-test-password", role: "minimal"
  204. setting 'xpack.license.self_generated.type', 'trial'
  205. setting 'xpack.security.enabled', 'true'
  206. }