Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
prometheus-operator: Fix unit test
Browse files Browse the repository at this point in the history
Return when the test that wants error, errors out. This means the test
has passed and should not be proceeded further.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
  • Loading branch information
surajssd committed Aug 3, 2020
1 parent f1a7ba9 commit 1458bbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/components/prometheus-operator/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ component "prometheus-operator" {

if tc.wantErr && !d.HasErrors() {
t.Fatal("wrong config should have returned an error")
} else if tc.wantErr && d.HasErrors() {
// This means that test has passed and there is no need to go forward, we can safely
// return.
return
}

m, err := c.RenderManifests()
Expand Down

0 comments on commit 1458bbd

Please sign in to comment.