-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalendar_crud.yml
107 lines (95 loc) · 2.18 KB
/
calendar_crud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
requires:
serverless: true
stack: true
---
teardown:
- do:
ml.delete_calendar:
calendar_id: "advent"
- do:
ml.delete_calendar:
calendar_id: "weeks_of_the_year"
- do:
ml.delete_job:
job_id: 'cal'
wait_for_completion: true
- do:
ml.delete_job:
job_id: 'cal2'
wait_for_completion: true
---
"Test calendar CRUD":
- do:
ml.get_calendars:
calendar_id: _all
- match: { count: 0 }
- do:
ml.put_job:
job_id: cal
body: >
{
"analysis_config" : {
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
},
"data_description" : {
}
}
- match: { job_id: "cal" }
- do:
ml.put_job:
job_id: cal2
body: >
{
"analysis_config" : {
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
},
"data_description" : {
}
}
- match: { job_id: "cal2" }
- do:
ml.put_calendar:
calendar_id: "advent"
body: >
{
"job_ids": ["cal", "cal2"],
"description": "This is a calendar about..."
}
- match: { calendar_id: advent }
- match: { job_ids.0: cal }
- match: { job_ids.1: cal2 }
- match: { description: "This is a calendar about..." }
- do:
ml.get_calendars:
calendar_id: "advent"
- match: { count: 1 }
- match:
calendars.0:
calendar_id: "advent"
job_ids: ["cal", "cal2"]
description: "This is a calendar about..."
- is_false: type
- do:
ml.put_calendar:
calendar_id: "tides_of_the_year"
body: >
{
"job_ids": ["cal"]
}
- do:
ml.put_calendar:
calendar_id: "weeks_of_the_year"
- do:
ml.get_calendars: {}
- match: { count: 3 }
- do:
ml.delete_calendar:
calendar_id: "tides_of_the_year"
- do:
ml.get_calendars: {}
- match: { count: 2 }
- do:
ml.get_calendars:
calendar_id: _all
- match: { count: 2 }