Skip to content

Commit b19c7e7

Browse files
committed
Updates bucket tests.
`get_buckets` is private in Serverless
1 parent e53aba2 commit b19c7e7

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
requires:
3+
serverless: true
4+
stack: false
5+
---
6+
setup:
7+
- do:
8+
ml.put_job:
9+
job_id: jobs-get-result-buckets
10+
body: >
11+
{
12+
"analysis_config" : {
13+
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
14+
},
15+
"data_description" : {
16+
"format":"xcontent",
17+
"time_field":"time"
18+
}
19+
}
20+
21+
- do:
22+
index:
23+
index: .ml-anomalies-jobs-get-result-buckets
24+
id: "jobs-get-result-buckets_1464739200000_1"
25+
body:
26+
{
27+
"job_id": "jobs-get-result-buckets",
28+
"result_type": "bucket",
29+
"timestamp": "2016-06-01T00:00:00Z",
30+
"anomaly_score": 90.0,
31+
"bucket_span":1
32+
}
33+
- do:
34+
indices.refresh:
35+
index: .ml-anomalies-jobs-get-result-buckets
36+
---
37+
teardown:
38+
- do:
39+
ml.delete_job:
40+
job_id: jobs-get-result-buckets
41+
---
42+
"Test buckets":
43+
- do:
44+
ml.get_overall_buckets:
45+
job_id: "jobs-get-result-*"
46+
- gte: { count: 1 }

tests/machine_learning/buckets.yml tests/machine_learning/buckets_stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
requires:
3-
serverless: true
3+
serverless: false
44
stack: true
55
---
66
setup:

0 commit comments

Comments
 (0)