fix integration test for tabular view
parent
6c7cadb371
commit
b36bc1ec66
test/integration
|
@ -563,31 +563,14 @@ func validateAddonsCmd(ctx context.Context, t *testing.T, profile string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom format
|
// Table output
|
||||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list", "--format", `"{{.AddonName}}":"{{.AddonStatus}}"`))
|
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%s failed: %v", rr.Args, err)
|
t.Errorf("%s failed: %v", rr.Args, err)
|
||||||
}
|
}
|
||||||
listLines = strings.Split(strings.TrimSpace(rr.Stdout.String()), "\n")
|
for _, a := range []string{"dashboard", "ingress", "ingress-dns"} {
|
||||||
r = regexp.MustCompile(`"[a-z|-]+":"(enabled|disabled)"`)
|
if !strings.Contains(rr.Output(), a) {
|
||||||
for _, line := range listLines {
|
t.Errorf("addon list expected to include %q but didn't output: %q", a, rr.Output())
|
||||||
match := r.MatchString(line)
|
|
||||||
if !match {
|
|
||||||
t.Errorf("Plugin output did not match expected custom format. Got: %s", line)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Custom format shorthand
|
|
||||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "list", "-f", `"{{.AddonName}}":"{{.AddonStatus}}"`))
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("%s failed: %v", rr.Args, err)
|
|
||||||
}
|
|
||||||
listLines = strings.Split(strings.TrimSpace(rr.Stdout.String()), "\n")
|
|
||||||
r = regexp.MustCompile(`"[a-z|-]+":"(enabled|disabled)"`)
|
|
||||||
for _, line := range listLines {
|
|
||||||
match := r.MatchString(line)
|
|
||||||
if !match {
|
|
||||||
t.Errorf("Plugin output did not match expected custom format. Got: %s", line)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue