-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Description
As shown in #481 today if there is a failure in operator-developer-e2e
due to unexpected condition we get a message like this:
Status conditions for the operator plain-operator for the version 0.2.0 is not as expected:Expected status: True, but got: False
We should include condition message when failing test due to unexpected condition as it usually contains useful information.
Relevant code:
operator-controller/test/operator-framework-e2e/operator_framework_test.go
Lines 769 to 783 in a00a93f
func checkConditionEquals(actualCond, expectedCond *metav1.Condition) error { | |
if actualCond == nil { | |
return fmt.Errorf("Expected condition %s to not be nil", expectedCond.Type) | |
} | |
if actualCond.Status != expectedCond.Status { | |
return fmt.Errorf("Expected status: %s, but got: %s", expectedCond.Status, actualCond.Status) | |
} | |
if actualCond.Reason != expectedCond.Reason { | |
return fmt.Errorf("Expected reason: %s but got: %s", expectedCond.Reason, actualCond.Reason) | |
} | |
if !strings.Contains(actualCond.Message, expectedCond.Message) { | |
return fmt.Errorf("Expected message: %s but got: %s", expectedCond.Message, actualCond.Message) | |
} | |
return nil | |
} |
Metadata
Metadata
Assignees
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.