wip: test for scaling policy parsing

This commit is contained in:
Chris Baker 2020-01-16 15:44:40 +00:00
parent 1f844a54f9
commit 8626e32557
2 changed files with 36 additions and 0 deletions

View File

@ -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 {

View File

@ -0,0 +1,13 @@
job "elastic" {
group "group" {
scaling {
enabled = false
policy {
foo = "bar"
b = true
val = 5
f = .1
}
}
}
}