Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhii Zakharov committed Jun 2, 2022
1 parent 8a366a5 commit 08f1d72
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/gatherers/conditional/conditions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,28 @@ func Test_areAllConditionsSatisfied(t *testing.T) {
},
}

// no conditions are satisfied
ok, err := g.areAllConditionsSatisfied(conditions)
assert.NoError(t, err)
assert.False(t, ok)

// only one condition is satisfied
g.firingAlerts["APIRemovedInNextEUSReleaseInUse"] = []AlertLabels{}
g.clusterVersion = "4.9.0"
ok, err = g.areAllConditionsSatisfied(conditions)
assert.NoError(t, err)
assert.False(t, ok)

// still one condition
g.firingAlerts = map[string][]AlertLabels{}
g.clusterVersion = "4.11.0-0.nightly-2022-05-25-193227"
ok, err = g.areAllConditionsSatisfied(conditions)
assert.NoError(t, err)
assert.False(t, ok)

// finally both
g.firingAlerts["APIRemovedInNextEUSReleaseInUse"] = []AlertLabels{}
g.clusterVersion = "4.11.0-0.nightly-2022-05-25-193227"
ok, err = g.areAllConditionsSatisfied(conditions)
assert.NoError(t, err)
assert.True(t, ok)
Expand Down

0 comments on commit 08f1d72

Please sign in to comment.