Skip to content

Commit

Permalink
improved test library
Browse files Browse the repository at this point in the history
  • Loading branch information
facchettos committed Jul 19, 2024
1 parent baf2318 commit 1c063be
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions pkg/controllers/syncer/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,10 @@ type SyncTest struct {

func RunTests(t *testing.T, tests []*SyncTest) {
// run focus first
hasFocus := false
for _, test := range tests {
if test.Focus {
t.Run(test.Name, func(t *testing.T) {
test.Run(t, test, NewFakeRegisterContext)
hasFocus = true
}
}

if !hasFocus {
for _, test := range tests {
test.Run(t, test, NewFakeRegisterContext)
}
} else {
// Fail test set so that we do not accidentally use focused tests in
// the pipeline
t.Error("Focused test")
})
}
}

Expand Down

0 comments on commit 1c063be

Please sign in to comment.