build.gradle 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. apply plugin: 'elasticsearch.yaml-rest-test'
  2. dependencies {
  3. yamlRestTestImplementation(testArtifact(project(xpackModule('core'))))
  4. yamlRestTestImplementation(testArtifact(xpackProject('plugin')))
  5. }
  6. // bring in machine learning rest test suite
  7. restResources {
  8. restApi {
  9. includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'search', 'get', 'count', 'ingest', 'bulk'
  10. includeXpack 'ml', 'cat'
  11. }
  12. restTests {
  13. includeXpack 'ml'
  14. }
  15. }
  16. tasks.named("yamlRestTest").configure {
  17. systemProperty 'tests.rest.blacklist', [
  18. // Remove this test because it doesn't call an ML endpoint and we don't want
  19. // to grant extra permissions to the users used in this test suite
  20. 'ml/ml_classic_analyze/Test analyze API with an analyzer that does what we used to do in native code',
  21. // Remove tests that are expected to throw an exception, because we cannot then
  22. // know whether to expect an authorization exception or a validation exception
  23. 'ml/calendar_crud/Test get calendar given missing',
  24. 'ml/calendar_crud/Test cannot create calendar with name _all',
  25. 'ml/calendar_crud/Test PageParams with ID is invalid',
  26. 'ml/calendar_crud/Test post calendar events given empty events',
  27. 'ml/calendar_crud/Test put calendar given id contains invalid chars',
  28. 'ml/calendar_crud/Test delete event from non existing calendar',
  29. 'ml/calendar_crud/Test delete job from non existing calendar',
  30. 'ml/custom_all_field/Test querying custom all field',
  31. 'ml/datafeeds_crud/Test delete datafeed with missing id',
  32. 'ml/datafeeds_crud/Test put datafeed referring to missing job_id',
  33. 'ml/datafeeds_crud/Test put datafeed with invalid query',
  34. 'ml/datafeeds_crud/Test put datafeed with security headers in the body',
  35. 'ml/datafeeds_crud/Test update datafeed with missing id',
  36. 'ml/data_frame_analytics_crud/Test put config with security headers in the body',
  37. 'ml/data_frame_analytics_crud/Test put config with create_time in the body',
  38. 'ml/data_frame_analytics_crud/Test put config with version in the body',
  39. 'ml/data_frame_analytics_crud/Test put config with inconsistent body/param ids',
  40. 'ml/data_frame_analytics_crud/Test put config with invalid id',
  41. 'ml/data_frame_analytics_crud/Test put config with invalid dest index name',
  42. 'ml/data_frame_analytics_crud/Test put config with pattern dest index name',
  43. 'ml/data_frame_analytics_crud/Test put config with missing concrete source index',
  44. 'ml/data_frame_analytics_crud/Test put config with missing wildcard source index',
  45. 'ml/data_frame_analytics_crud/Test put config with dest index same as source index',
  46. 'ml/data_frame_analytics_crud/Test put config with dest index matching multiple indices',
  47. 'ml/data_frame_analytics_crud/Test put config with dest index included in source via alias',
  48. 'ml/data_frame_analytics_crud/Test put config with remote source index',
  49. 'ml/data_frame_analytics_crud/Test put config with unknown top level field',
  50. 'ml/data_frame_analytics_crud/Test put config with unknown field in outlier detection analysis',
  51. 'ml/data_frame_analytics_crud/Test put config given analyzed_fields include field excluded by source',
  52. 'ml/data_frame_analytics_crud/Test put config given missing source',
  53. 'ml/data_frame_analytics_crud/Test put config given source with empty index array',
  54. 'ml/data_frame_analytics_crud/Test put config given source with empty string in index array',
  55. 'ml/data_frame_analytics_crud/Test put config given source without index',
  56. 'ml/data_frame_analytics_crud/Test put config given missing dest',
  57. 'ml/data_frame_analytics_crud/Test put config given dest index contains uppercase chars',
  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 max_trees is zero',
  75. 'ml/data_frame_analytics_crud/Test put regression given max_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 zero',
  79. 'ml/data_frame_analytics_crud/Test put regression given training_percent is greater than hundred',
  80. 'ml/data_frame_analytics_crud/Test put regression given loss_function_parameter is zero',
  81. 'ml/data_frame_analytics_crud/Test put regression given loss_function_parameter is negative',
  82. 'ml/data_frame_analytics_crud/Test put classification given dependent_variable is not defined',
  83. 'ml/data_frame_analytics_crud/Test put classification given negative lambda',
  84. 'ml/data_frame_analytics_crud/Test put classification given negative gamma',
  85. 'ml/data_frame_analytics_crud/Test put classification given eta less than 1e-3',
  86. 'ml/data_frame_analytics_crud/Test put classification given eta greater than one',
  87. 'ml/data_frame_analytics_crud/Test put classification given max_trees is zero',
  88. 'ml/data_frame_analytics_crud/Test put classification given max_trees is greater than 2k',
  89. 'ml/data_frame_analytics_crud/Test put classification given feature_bag_fraction is negative',
  90. 'ml/data_frame_analytics_crud/Test put classification given feature_bag_fraction is greater than one',
  91. 'ml/data_frame_analytics_crud/Test put classification given num_top_classes is less than minus one',
  92. 'ml/data_frame_analytics_crud/Test put classification given num_top_classes is greater than 1k',
  93. 'ml/data_frame_analytics_crud/Test put classification given training_percent is less than zero',
  94. 'ml/data_frame_analytics_crud/Test put classification given training_percent is greater than hundred',
  95. 'ml/estimate_model_memory/Test missing overall cardinality',
  96. 'ml/estimate_model_memory/Test missing max bucket cardinality',
  97. 'ml/evaluate_data_frame/Test given missing index',
  98. 'ml/evaluate_data_frame/Test given index does not exist',
  99. 'ml/evaluate_data_frame/Test given missing evaluation',
  100. 'ml/evaluate_data_frame/Test outlier_detection auc_roc given actual_field is always true',
  101. 'ml/evaluate_data_frame/Test outlier_detection auc_roc given actual_field is always false',
  102. 'ml/evaluate_data_frame/Test outlier_detection given evaluation with empty metrics',
  103. 'ml/evaluate_data_frame/Test outlier_detection given missing actual_field',
  104. 'ml/evaluate_data_frame/Test outlier_detection given missing predicted_probability_field',
  105. 'ml/evaluate_data_frame/Test outlier_detection given precision with threshold less than zero',
  106. 'ml/evaluate_data_frame/Test outlier_detection given recall with threshold less than zero',
  107. 'ml/evaluate_data_frame/Test outlier_detection given confusion_matrix with threshold less than zero',
  108. 'ml/evaluate_data_frame/Test outlier_detection given precision with empty thresholds',
  109. 'ml/evaluate_data_frame/Test outlier_detection given recall with empty thresholds',
  110. 'ml/evaluate_data_frame/Test outlier_detection given confusion_matrix with empty thresholds',
  111. 'ml/evaluate_data_frame/Test classification given evaluation with empty metrics',
  112. 'ml/evaluate_data_frame/Test classification given missing actual_field',
  113. 'ml/evaluate_data_frame/Test classification given missing predicted_field',
  114. 'ml/evaluate_data_frame/Test classification given missing top_classes_field',
  115. 'ml/evaluate_data_frame/Test classification auc_roc given actual_field is never equal to fish',
  116. 'ml/evaluate_data_frame/Test classification auc_roc given predicted_class_field is never equal to mouse',
  117. 'ml/evaluate_data_frame/Test classification auc_roc with missing class_name',
  118. 'ml/evaluate_data_frame/Test classification accuracy with missing predicted_field',
  119. 'ml/evaluate_data_frame/Test regression given evaluation with empty metrics',
  120. 'ml/evaluate_data_frame/Test regression given missing actual_field',
  121. 'ml/evaluate_data_frame/Test regression given missing predicted_field',
  122. 'ml/explain_data_frame_analytics/Test neither job id nor body',
  123. 'ml/explain_data_frame_analytics/Test both job id and body',
  124. 'ml/explain_data_frame_analytics/Test missing job',
  125. 'ml/explain_data_frame_analytics/Test empty data frame given body',
  126. 'ml/delete_job_force/Test cannot force delete a non-existent job',
  127. 'ml/delete_model_snapshot/Test delete snapshot missing snapshotId',
  128. 'ml/delete_model_snapshot/Test delete snapshot missing job_id',
  129. 'ml/filter_crud/Test create filter api with mismatching body ID',
  130. 'ml/filter_crud/Test create filter given invalid filter_id',
  131. 'ml/filter_crud/Test get filter API with bad ID',
  132. 'ml/filter_crud/Test non-existing filter',
  133. 'ml/filter_crud/Test update filter given remove item is not present',
  134. 'ml/filter_crud/Test get all filter given index exists but no mapping for filter_id',
  135. 'ml/get_datafeed_stats/Test get datafeed stats given missing datafeed_id',
  136. 'ml/get_datafeeds/Test get datafeed given missing datafeed_id',
  137. 'ml/inference_crud/Test delete given used trained model',
  138. 'ml/inference_crud/Test delete with missing model',
  139. 'ml/inference_crud/Test get given missing trained model',
  140. 'ml/inference_crud/Test get given expression without matches and allow_no_match is false',
  141. 'ml/inference_crud/Test put ensemble with empty models',
  142. 'ml/inference_crud/Test put ensemble with tree where tree has out of bounds feature_names index',
  143. 'ml/inference_crud/Test put model with empty input.field_names',
  144. 'ml/inference_crud/Test PUT model where target type and inference config mismatch',
  145. 'ml/inference_crud/Test update model alias with model id referring to missing model',
  146. 'ml/inference_crud/Test update model alias with bad alias',
  147. 'ml/inference_crud/Test update model alias where alias exists but old model id is different inference type',
  148. 'ml/inference_crud/Test update model alias where alias exists but reassign is false',
  149. 'ml/inference_processor/Test create processor with missing mandatory fields',
  150. 'ml/inference_stats_crud/Test get stats given missing trained model',
  151. 'ml/inference_stats_crud/Test get stats given expression without matches and allow_no_match is false',
  152. 'ml/jobs_crud/Test cannot create job with model snapshot id set',
  153. 'ml/jobs_crud/Test get job API with non existing job id',
  154. 'ml/jobs_crud/Test put job with inconsistent body/param ids',
  155. 'ml/jobs_crud/Test put job with inconsistent model snapshot settings',
  156. 'ml/jobs_crud/Test put job with time field in analysis_config',
  157. 'ml/jobs_crud/Test put job with duplicate detector configurations',
  158. 'ml/jobs_crud/Test job with categorization_analyzer and categorization_filters',
  159. 'ml/jobs_get/Test get job given missing job_id',
  160. 'ml/jobs_get_result_buckets/Test mutually-exclusive params',
  161. 'ml/jobs_get_result_buckets/Test mutually-exclusive params via body',
  162. 'ml/jobs_get_result_categories/Test with invalid param combinations',
  163. 'ml/jobs_get_result_categories/Test with invalid param combinations via body',
  164. 'ml/jobs_get_result_overall_buckets/Test overall buckets given missing job',
  165. 'ml/jobs_get_result_overall_buckets/Test overall buckets given non-matching expression and not allow_no_match',
  166. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is 0',
  167. 'ml/jobs_get_result_overall_buckets/Test overall buckets given top_n is negative',
  168. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid start param',
  169. 'ml/jobs_get_result_overall_buckets/Test overall buckets given invalid end param',
  170. 'ml/jobs_get_result_overall_buckets/Test overall buckets given bucket_span is smaller than max job bucket_span',
  171. 'ml/jobs_get_stats/Test get job stats given missing job',
  172. 'ml/jobs_get_stats/Test no exception on get job stats with missing index',
  173. 'ml/job_groups/Test put job with empty group',
  174. 'ml/job_groups/Test put job with group that matches an job id',
  175. 'ml/job_groups/Test put job with group that matches its id',
  176. 'ml/job_groups/Test put job with id that matches an existing group',
  177. 'ml/job_groups/Test put job with invalid group',
  178. 'ml/ml_info/Test ml info',
  179. 'ml/pipeline_inference/Test setting results field is invalid',
  180. 'ml/post_data/Test Flush data with invalid parameters',
  181. 'ml/post_data/Test flushing and posting a closed job',
  182. 'ml/post_data/Test open and close with non-existent job id',
  183. 'ml/post_data/Test POST data with invalid parameters',
  184. 'ml/preview_datafeed/Test preview missing datafeed',
  185. 'ml/revert_model_snapshot/Test revert model with invalid snapshotId',
  186. 'ml/start_data_frame_analytics/Test start given missing source index',
  187. 'ml/start_data_frame_analytics/Test start outlier_detection given source index has no fields',
  188. 'ml/start_data_frame_analytics/Test start regression given source index only has dependent variable',
  189. 'ml/start_data_frame_analytics/Test start with inconsistent body/param ids',
  190. 'ml/start_data_frame_analytics/Test start given dest index is not empty',
  191. 'ml/start_data_frame_analytics/Test start with compatible fields but no data',
  192. 'ml/start_stop_datafeed/Test start datafeed job, but not open',
  193. 'ml/start_stop_datafeed/Test start non existing datafeed',
  194. 'ml/start_stop_datafeed/Test stop non existing datafeed',
  195. 'ml/validate/Test invalid job config',
  196. 'ml/validate/Test job config is invalid because model snapshot id set',
  197. 'ml/validate/Test job config that is invalid only because of the job ID',
  198. 'ml/validate/Test job config with duplicate detector configurations',
  199. 'ml/validate_detector/Test invalid detector',
  200. 'ml/delete_forecast/Test delete on _all forecasts not allow no forecasts',
  201. 'ml/delete_forecast/Test delete forecast on missing forecast',
  202. 'ml/set_upgrade_mode/Attempt to open job when upgrade_mode is enabled',
  203. 'ml/set_upgrade_mode/Setting upgrade_mode to enabled',
  204. 'ml/set_upgrade_mode/Setting upgrade mode to disabled from enabled',
  205. 'ml/set_upgrade_mode/Test setting upgrade_mode to false when it is already false'
  206. ].join(',')
  207. }
  208. testClusters.all {
  209. testDistribution = 'DEFAULT'
  210. extraConfigFile 'roles.yml', file('roles.yml')
  211. user username: "x_pack_rest_user", password: "x-pack-test-password"
  212. user username: "ml_admin", password: "x-pack-test-password", role: "minimal,machine_learning_admin,ingest_admin"
  213. user username: "ml_user", password: "x-pack-test-password", role: "minimal,machine_learning_user"
  214. user username: "no_ml", password: "x-pack-test-password", role: "minimal"
  215. setting 'xpack.license.self_generated.type', 'trial'
  216. setting 'xpack.security.enabled', 'true'
  217. }