Skip to content

Commit

Permalink
serial: use helper function to validate degraded status
Browse files Browse the repository at this point in the history
The package has already `isDegradedWith` which verifies if the degraded
reason and message is as expected, let's use it instead of duplicating
the same check.

Signed-off-by: Shereen Haj <shajmakh@redhat.com>
  • Loading branch information
shajmakh committed Feb 25, 2025
1 parent 6a185eb commit 067b1b6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/e2e/serial/tests/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,11 +1184,7 @@ var _ = Describe("[serial][disruptive] numaresources configuration management",

By("verify degraded condition is found due to node group with multiple selectors")
Expect(fxt.Client.Get(ctx, nroKey, &updatedNRO)).To(Succeed())
cond := status.FindCondition(updatedNRO.Status.Conditions, status.ConditionDegraded)
Expect(cond).NotTo(BeNil(), "condition Degraded was not found: %+v", updatedNRO.Status.Conditions)
Expect(cond.Reason).To(Equal(validation.NodeGroupsError), "reason of the conditions is different from expected: expected %q found %q", validation.NodeGroupsError, cond.Reason)
expectedCondMsg := "must have only a single specifier set"
Expect(strings.Contains(cond.Message, expectedCondMsg)).To(BeTrue(), "different degrade message was found: expected to contains %q but found %q", "must have only a single specifier set", expectedCondMsg, cond.Message)
Expect(isDegradedWith(updatedNRO.Status.Conditions, "must have only a single specifier set", validation.NodeGroupsError)).To(BeTrue(), "Condition not degraded as expected")
})

It("[tier1] should report the NodeGroupConfig in the NodeGroupStatus with NodePool set and allow updates", func(ctx context.Context) {
Expand Down

0 comments on commit 067b1b6

Please sign in to comment.