Skip to content

Commit be32a57

Browse files
Change sub operator to grc-mock operator
1. Fix host test flaky issue. case38:3702 Signed-off-by: yiraeChristineKim <[email protected]>
1 parent d34a9d8 commit be32a57

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

test/e2e/case38_install_operator_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import (
2424
"open-cluster-management.io/config-policy-controller/test/utils"
2525
)
2626

27-
var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), func() {
27+
var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), func() {
2828
const (
2929
opPolTestNS = "operator-policy-testns"
3030
parentPolicyYAML = "../resources/case38_operator_install/parent-policy.yaml"
3131
parentPolicyName = "parent-policy"
32-
eventuallyTimeout = 120
32+
eventuallyTimeout = 90
3333
consistentlyDuration = 5
3434
olmWaitTimeout = 60
3535
)
@@ -3451,7 +3451,7 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
34513451
const (
34523452
opPolYAML = "../resources/case38_operator_install/operator-policy-no-group-enforce.yaml"
34533453
opPolName = "oppol-no-group-enforce"
3454-
subName = "project-quay"
3454+
subName = "example-operator"
34553455
)
34563456

34573457
scenarioTriggered := true
@@ -3649,10 +3649,11 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
36493649
const (
36503650
opPolYAML = "../resources/case38_operator_install/operator-policy-no-group-enforce.yaml"
36513651
opPolName = "oppol-no-group-enforce"
3652-
latestQuay310 = "quay-operator.v3.10.7"
3652+
latestExample = "example-operator.v0.0.3"
36533653
)
36543654

3655-
BeforeEach(func() {
3655+
// The first 'It' test is a prerequisite for the second 'It' test.
3656+
BeforeAll(func() {
36563657
preFunc()
36573658

36583659
createObjWithParent(parentPolicyYAML, parentPolicyName,
@@ -3662,7 +3663,7 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
36623663
It("Should start compliant", func(ctx SpecContext) {
36633664
Eventually(func(ctx SpecContext) (map[string]interface{}, error) {
36643665
csv, err := targetK8sDynamic.Resource(gvrClusterServiceVersion).Namespace(opPolTestNS).
3665-
Get(ctx, latestQuay310, metav1.GetOptions{})
3666+
Get(ctx, latestExample, metav1.GetOptions{})
36663667

36673668
if csv == nil || err != nil {
36683669
return map[string]interface{}{}, err
@@ -3710,17 +3711,17 @@ var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), f
37103711
APIVersion: "operators.coreos.com/v1alpha1",
37113712
Metadata: policyv1.ObjectMetadata{
37123713
Namespace: opPolTestNS,
3713-
Name: latestQuay310,
3714+
Name: latestExample,
37143715
},
37153716
},
37163717
Compliant: "NonCompliant",
3717-
Reason: "ClusterServiceVersion (" + latestQuay310 + ") is not an approved version",
3718+
Reason: "ClusterServiceVersion (" + latestExample + ") is not an approved version",
37183719
}},
37193720
metav1.Condition{
37203721
Type: "ClusterServiceVersionCompliant",
37213722
Status: metav1.ConditionFalse,
37223723
Reason: "UnapprovedVersion",
3723-
Message: "ClusterServiceVersion (" + latestQuay310 + ") is not an approved version",
3724+
Message: "ClusterServiceVersion (" + latestExample + ") is not an approved version",
37243725
},
37253726
"ClusterServiceVersion .* is not an approved version",
37263727
)

test/resources/case38_operator_install/operator-policy-no-group-enforce.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ spec:
1515
severity: medium
1616
complianceType: musthave
1717
subscription:
18-
channel: stable-3.10
19-
name: project-quay
18+
channel: stable
19+
name: example-operator
2020
namespace: operator-policy-testns
21-
source: operatorhubio-catalog
21+
source: grc-mock-source
2222
sourceNamespace: olm
2323
upgradeApproval: Automatic

0 commit comments

Comments
 (0)