mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +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() {
|
||||
t.Logf("Running testcase: %s", testcaseName)
|
||||
t.Run(testcaseName, func(t *testing.T) {
|
||||
i = 0
|
||||
name = testcaseName
|
||||
testcase = EditTestCase{}
|
||||
@ -240,8 +240,7 @@ func TestEdit(t *testing.T) {
|
||||
case "edit-last-applied":
|
||||
cmd = NewCmdApplyEditLastApplied(f, buf, errBuf)
|
||||
default:
|
||||
t.Errorf("%s: unexpected mode %s", name, testcase.Mode)
|
||||
continue
|
||||
t.Fatalf("%s: unexpected mode %s", name, testcase.Mode)
|
||||
}
|
||||
if len(testcase.Filename) > 0 {
|
||||
cmd.Flags().Set("filename", filepath.Join(testcaseDir, testcase.Filename))
|
||||
@ -281,6 +280,7 @@ func TestEdit(t *testing.T) {
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user