wip: test for scaling policy parsing
This commit is contained in:
parent
1f844a54f9
commit
8626e32557
|
@ -1129,6 +1129,29 @@ func TestParse(t *testing.T) {
|
|||
},
|
||||
false,
|
||||
},
|
||||
|
||||
{
|
||||
"tg-scaling-policy.hcl",
|
||||
&api.Job{
|
||||
ID: helper.StringToPtr("elastic"),
|
||||
Name: helper.StringToPtr("elastic"),
|
||||
TaskGroups: []*api.TaskGroup{
|
||||
{
|
||||
Name: helper.StringToPtr("group"),
|
||||
Scaling: &api.ScalingPolicy{
|
||||
Policy: map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"b": true,
|
||||
"val": 5,
|
||||
"f": .1,
|
||||
},
|
||||
Enabled: helper.BoolToPtr(false),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
job "elastic" {
|
||||
group "group" {
|
||||
scaling {
|
||||
enabled = false
|
||||
policy {
|
||||
foo = "bar"
|
||||
b = true
|
||||
val = 5
|
||||
f = .1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue