Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ test-e2e: test-e2e-wait-for-stable-state ## Run end-to-end tests.
-timeout $(E2E_TIMEOUT) \
-count 1 -v -p 1 \
-tags e2e -run "$(TEST)" . \
-ginkgo.label-filter='$(E2E_GINKGO_LABEL_FILTER)'
-ginkgo.label-filter="$(E2E_GINKGO_LABEL_FILTER)"

.PHONY: test-e2e-wait-for-stable-state
test-e2e-wait-for-stable-state:
Expand Down
17 changes: 16 additions & 1 deletion test/e2e/condition_matcher_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package e2e
import (
"strings"
"testing"
"time"

opv1 "github.com/openshift/api/operator/v1"
operatorv1alpha1 "github.com/openshift/cert-manager-operator/api/operator/v1alpha1"
Expand Down Expand Up @@ -119,6 +120,20 @@ func TestVerifyOperatorStatusCondition(t *testing.T) {
expectError: true,
errorContains: "context deadline exceeded",
},
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: "Any mode succeeds when matching condition appears after non-matching one",
expectedConditions: map[string]opv1.ConditionStatus{
"Degraded": opv1.ConditionTrue,
},
initialObjects: []runtime.Object{
newCertManagerObjectWithConditions(
opv1.OperatorCondition{Type: controllerPrefix + "-static-resources-Degraded", Status: opv1.ConditionFalse},
opv1.OperatorCondition{Type: controllerPrefix + "Degraded", Status: opv1.ConditionTrue},
),
},
matchAny: true,
expectError: false,
},
{
name: "A missing condition for Progressing",
expectedConditions: map[string]opv1.ConditionStatus{
Expand Down Expand Up @@ -149,7 +164,7 @@ func TestVerifyOperatorStatusCondition(t *testing.T) {
{controllerPrefix, tt.matchAny},
}, tt.expectedConditions)

err := verifyOperatorStatusCondition(fakeClient.OperatorV1alpha1(), matchers)
err := verifyOperatorStatusConditionWithTimeout(fakeClient.OperatorV1alpha1(), matchers, 10*time.Second)

if tt.expectError && err == nil {
t.Errorf("Expected an error, but got nil")
Expand Down