mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Make edit test use subtests to identify flake
This commit is contained in:
parent
d77b95723c
commit
5519a7c5e9
@ -193,7 +193,7 @@ func TestEdit(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, testcaseName := range testcases.List() {
|
for _, testcaseName := range testcases.List() {
|
||||||
t.Logf("Running testcase: %s", testcaseName)
|
t.Run(testcaseName, func(t *testing.T) {
|
||||||
i = 0
|
i = 0
|
||||||
name = testcaseName
|
name = testcaseName
|
||||||
testcase = EditTestCase{}
|
testcase = EditTestCase{}
|
||||||
@ -240,8 +240,7 @@ func TestEdit(t *testing.T) {
|
|||||||
case "edit-last-applied":
|
case "edit-last-applied":
|
||||||
cmd = NewCmdApplyEditLastApplied(f, buf, errBuf)
|
cmd = NewCmdApplyEditLastApplied(f, buf, errBuf)
|
||||||
default:
|
default:
|
||||||
t.Errorf("%s: unexpected mode %s", name, testcase.Mode)
|
t.Fatalf("%s: unexpected mode %s", name, testcase.Mode)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if len(testcase.Filename) > 0 {
|
if len(testcase.Filename) > 0 {
|
||||||
cmd.Flags().Set("filename", filepath.Join(testcaseDir, testcase.Filename))
|
cmd.Flags().Set("filename", filepath.Join(testcaseDir, testcase.Filename))
|
||||||
@ -281,6 +280,7 @@ func TestEdit(t *testing.T) {
|
|||||||
if i < len(testcase.Steps) {
|
if i < len(testcase.Steps) {
|
||||||
t.Errorf("%s: saw %d steps, testcase included %d additional steps that were not exercised", name, i, len(testcase.Steps)-i)
|
t.Errorf("%s: saw %d steps, testcase included %d additional steps that were not exercised", name, i, len(testcase.Steps)-i)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user