Skip to content

Commit

Permalink
Add rest test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Jan 28, 2019
1 parent d79a601 commit bf6e8e9
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,46 @@ setup:
- length: { index_settings: 0 }
- length: { ml_settings: 0 }

---
"Test ml":
- skip:
features: ["headers", "warnings"]
reason: testing a deprecated field

# Index the config directly to prevent the deprecated
# use_dis_max field being rewritten by the parser. This
# simulates the config being created in an older version
# of elasticsearch
- do:
headers:
Content-Type: application/json
index:
index: .ml-config
type: doc
id: deprecation-datafeed-datafeed
body: >
{
"datafeed_id" : "deprecation-datafeed",
"config_type" : "datafeed",
"job_id" : "deprecation-job",
"indices" : ["index-foo"],
"query" : {
"query_string" : {
"query" : "foo",
"use_dis_max" : true
}
}
}
- do:
indices.refresh:
index: [.ml-config]

- do:
warnings:
- Deprecated field [use_dis_max] used, replaced by [Set [tie_breaker] to 1 instead]
xpack.migration.deprecations:
index: "*"
- length: { ml_settings: 1 }
- match: { ml_settings.0.level : warning }
- match: { ml_settings.0.message : "Datafeed [deprecation-datafeed] uses deprecated query options" }

0 comments on commit bf6e8e9

Please sign in to comment.