Skip to content

Commit fe87bcb

Browse files
recover e2e
Signed-off-by: yiraeChristineKim <[email protected]>
1 parent 5789a91 commit fe87bcb

File tree

1 file changed

+24
-47
lines changed

1 file changed

+24
-47
lines changed

test/e2e/case38_install_operator_test.go

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

27-
var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), func() {
27+
var _ = FDescribe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), func() {
2828
const (
2929
opPolTestNS = "operator-policy-testns"
3030
parentPolicyYAML = "../resources/case38_operator_install/parent-policy.yaml"
@@ -318,7 +318,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
318318
Reason: "PolicyValidated",
319319
Message: `the policy spec is valid`,
320320
},
321-
`a relevant InstallPlan is actively installing`,
321+
`the policy spec is valid`,
322322
)
323323
})
324324
})
@@ -473,8 +473,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
473473
Message: "the policy does not specify an OperatorGroup but one already exists in the namespace" +
474474
" - assuming that OperatorGroup is correct",
475475
},
476-
// Still installPlan failed because the OperatorGroup is not correct
477-
"a relevant InstallPlan is actively installing",
476+
"assuming that OperatorGroup is correct",
478477
)
479478
})
480479
})
@@ -588,8 +587,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
588587
Reason: "OperatorGroupMatches",
589588
Message: "the OperatorGroup matches what is required by the policy",
590589
},
591-
// SubscriptionMissing blocks OperatorGroupMatches
592-
"",
590+
"the OperatorGroup matches what is required by the policy",
593591
)
594592
})
595593
It("Should report a mismatch when the OperatorGroup is manually edited", func() {
@@ -719,8 +717,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
719717
Reason: "SubscriptionMissing",
720718
Message: "the Subscription required by the policy was not found",
721719
},
722-
// OperatorGroupMismatch blocks SubscriptionMissing
723-
"",
720+
"the Subscription required by the policy was not found",
724721
)
725722
})
726723
It("Should not create the Subscription when another OperatorGroup already exists", func() {
@@ -780,7 +777,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
780777
Reason: "SubscriptionMissing",
781778
Message: "the Subscription required by the policy was not found",
782779
},
783-
"the OperatorGroup found on the cluster does not match the policy",
780+
"the Subscription required by the policy was not found",
784781
)
785782
})
786783

@@ -834,7 +831,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
834831
Reason: "ConstraintsNotSatisfiable",
835832
Message: "constraints not satisfiable: refer to the Subscription for more details",
836833
},
837-
"constraints not satisfiable: refer to the Subscription for more details",
834+
"the Subscription was updated to match the policy",
838835
)
839836
})
840837
})
@@ -876,8 +873,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
876873
Reason: "SubscriptionMatches",
877874
Message: "the Subscription matches what is required by the policy",
878875
},
879-
// OperatorGroupMissing blocks SubscriptionMatches
880-
"",
876+
"the Subscription matches what is required by the policy",
881877
)
882878
})
883879
It("Should notice the mismatch when the spec is changed in the policy", func() {
@@ -904,7 +900,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
904900
Reason: "SubscriptionMismatch",
905901
Message: "the Subscription found on the cluster does not match the policy",
906902
},
907-
"the OperatorGroup required by the policy was not found",
903+
"the Subscription found on the cluster does not match the policy",
908904
)
909905
})
910906
})
@@ -1092,9 +1088,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
10921088
Reason: "NoExistingDeployments",
10931089
Message: "no existing operator Deployments",
10941090
},
1095-
// ClusterServiceVersionCompliant UnsupportedOperatorGroup blocks
1096-
// "no existing operator Deployments"
1097-
"",
1091+
"no existing operator Deployments",
10981092
)
10991093
})
11001094

@@ -1151,8 +1145,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
11511145
Reason: "CatalogSourcesFound",
11521146
Message: "CatalogSource was found",
11531147
},
1154-
// OperatorGroupMissing blocks CatalogSourcesFound
1155-
"",
1148+
"CatalogSource was found",
11561149
)
11571150
})
11581151
It("Should remain compliant when policy is enforced", func() {
@@ -1211,8 +1204,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
12111204
Reason: "CatalogSourcesNotFound",
12121205
Message: "CatalogSource 'fakeName' was not found",
12131206
},
1214-
// SubscriptionCompliant ConstraintsNotSatisfiable blocks CatalogSourcesNotFound
1215-
"",
1207+
"CatalogSource 'fakeName' was not found",
12161208
)
12171209
})
12181210
It("Should report unhealthy status when CatalogSource fails", func() {
@@ -1246,8 +1238,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
12461238
Reason: "CatalogSourcesFoundUnhealthy",
12471239
Message: "CatalogSource was found but is unhealthy",
12481240
},
1249-
// CatalogSourceUnhealthy event is not created because of ClusterServiceVersion error
1250-
"",
1241+
"CatalogSource was found but is unhealthy",
12511242
)
12521243
})
12531244
It("Should become NonCompliant when ComplianceConfig is modified", func() {
@@ -1277,8 +1268,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
12771268
Reason: "CatalogSourcesFoundUnhealthy",
12781269
Message: "CatalogSource was found but is unhealthy",
12791270
},
1280-
// CatalogSourceUnhealthy event is not created because of ClusterServiceVersion error
1281-
"",
1271+
"CatalogSource was found but is unhealthy",
12821272
)
12831273
})
12841274
})
@@ -1372,9 +1362,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
13721362
Reason: "NoInstallPlansFound",
13731363
Message: "there are no relevant InstallPlans in the namespace",
13741364
},
1375-
// Due to SubscriptionCompliant error "NonCompliant;
1376-
// the InstallPlan event will not be created.
1377-
"",
1365+
"there are no relevant InstallPlans in the namespace",
13781366
)
13791367
})
13801368
It("Should report an available install when informing", func(ctx SpecContext) {
@@ -1602,8 +1590,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
16021590
Reason: "RelevantCRDNotFound",
16031591
Message: "no CRDs were found for the operator",
16041592
},
1605-
// "the OperatorGroup required by the policy was not found" blocks this message from being emitted
1606-
"",
1593+
"no CRDs were found for the operator",
16071594
)
16081595
})
16091596

@@ -1770,9 +1757,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
17701757
Reason: "InvalidPolicySpec",
17711758
Message: `spec.operatorGroup is invalid: json: unknown field "foo"`,
17721759
},
1773-
// ValidPolicySpec blocks OperatorGroupCompliant "the status of the OperatorGroup
1774-
// could not be determined because the policy is invalid"
1775-
"",
1760+
`spec.operatorGroup is invalid: json: unknown field "foo"`,
17761761
)
17771762
check(
17781763
opPolName,
@@ -1817,9 +1802,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
18171802
)
18181803
})
18191804
It("Should update the status after the namespace is created", func() {
1820-
// Create the nonexist-testns namespace
18211805
KubectlTarget("create", "namespace", "nonexist-testns")
1822-
18231806
check(
18241807
opPolName,
18251808
true,
@@ -1841,7 +1824,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
18411824
Reason: "PolicyValidated",
18421825
Message: "the policy spec is valid",
18431826
},
1844-
"",
1827+
"the policy spec is valid",
18451828
)
18461829
})
18471830
})
@@ -2069,8 +2052,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
20692052
Reason: "SubscriptionPresent",
20702053
Message: "the Subscription is present",
20712054
},
2072-
// OperatorGroup Present blocks Subscription Present
2073-
"",
2055+
`the Subscription is present`,
20742056
)
20752057
check(
20762058
opPolName,
@@ -2092,8 +2074,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
20922074
Reason: "InstallPlanNotApplicable",
20932075
Message: "MustNotHave policies ignore kind InstallPlan",
20942076
},
2095-
// OperatorGroup Present blocks Subscription Present
2096-
"",
2077+
`MustNotHave policies ignore kind InstallPlan`,
20972078
)
20982079
check(
20992080
opPolName,
@@ -2115,8 +2096,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
21152096
Reason: "ClusterServiceVersionPresent",
21162097
Message: "the ClusterServiceVersion (quay-operator.v3.10.0) is present",
21172098
},
2118-
// OperatorGroup Present blocks
2119-
"",
2099+
regexp.QuoteMeta("the ClusterServiceVersion (quay-operator.v3.10.0) is present"),
21202100
)
21212101
check(
21222102
opPolName,
@@ -2138,8 +2118,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
21382118
Reason: "CustomResourceDefinitionPresent",
21392119
Message: "the CustomResourceDefinition is present",
21402120
},
2141-
// OperatorGroup Present blocks
2142-
"",
2121+
`the CustomResourceDefinition is present`,
21432122
)
21442123
check(
21452124
opPolName,
@@ -2162,8 +2141,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
21622141
Reason: "DeploymentNotApplicable",
21632142
Message: "MustNotHave policies ignore kind Deployment",
21642143
},
2165-
// OperatorGroup Present blocks
2166-
"",
2144+
`MustNotHave policies ignore kind Deployment`,
21672145
)
21682146
check(
21692147
opPolName,
@@ -2186,8 +2164,7 @@ var _ = Describe("Testing OperatorPolicy", Ordered, Label("supports-hosted"), fu
21862164
Reason: "CatalogSourceNotApplicable",
21872165
Message: "MustNotHave policies ignore kind CatalogSource",
21882166
},
2189-
// OperatorGroup Present blocks
2190-
"",
2167+
`MustNotHave policies ignore kind CatalogSource`,
21912168
)
21922169
})
21932170

0 commit comments

Comments
 (0)