Skip to content

Commit 89733db

Browse files
author
Per Goncalves da Silva
committed
update e2e test to take opm version as a parameter
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent e9b5be5 commit 89733db

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events $(if $(E2E_F
251251

252252
.PHONY: e2e
253253
e2e: #HELP Run e2e tests against a cluster running OLM (params: $E2E_TEST_NS (operator), $E2E_INSTALL_NS (operator-lifecycle-manager), $E2E_CATALOG_NS (operator-lifecycle-manager), $E2E_TIMEOUT (90m), $E2E_FLAKE_ATTEMPTS (1), $TEST(undefined))
254-
$(GO_TEST_ENV) $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(E2E_OPTS)
254+
$(GO_TEST_ENV) $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) -opmVersion=$(OPERATOR_REGISTRY_VERSION) $(E2E_OPTS)
255255

256256
.PHONY: e2e-local
257257
e2e-local: e2e-build kind-create deploy e2e

test/e2e/catalog_e2e_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
4949
c operatorclient.ClientInterface
5050
crc versioned.Interface
5151
packageserverClient *packageserverclientset.Clientset
52+
testCatalogImage string
5253
)
5354

5455
BeforeEach(func() {
@@ -67,6 +68,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
6768
c = ctx.Ctx().KubeClient()
6869
crc = ctx.Ctx().OperatorClient()
6970
packageserverClient = packageserverclientset.NewForConfigOrDie(ctx.Ctx().RESTConfig())
71+
testCatalogImage = fmt.Sprintf("quay.io/olmtest/test-catalog:v%s", testOpmVersion)
7072
})
7173

7274
AfterEach(func() {
@@ -704,7 +706,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
704706
},
705707
Spec: v1alpha1.CatalogSourceSpec{
706708
SourceType: v1alpha1.SourceTypeGrpc,
707-
Image: communityOperatorsImage,
709+
Image: testCatalogImage,
708710
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
709711
SecurityContextConfig: v1alpha1.Restricted,
710712
},
@@ -764,7 +766,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
764766
},
765767
Spec: v1alpha1.CatalogSourceSpec{
766768
SourceType: v1alpha1.SourceTypeGrpc,
767-
Image: communityOperatorsImage,
769+
Image: testCatalogImage,
768770
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
769771
SecurityContextConfig: v1alpha1.Restricted,
770772
ExtractContent: &v1alpha1.ExtractContentConfig{
@@ -1075,7 +1077,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10751077
},
10761078
Spec: v1alpha1.CatalogSourceSpec{
10771079
SourceType: v1alpha1.SourceTypeGrpc,
1078-
Image: catSrcImage + ":1.0.0-with-ListBundles-method",
1080+
Image: fmt.Sprintf("%s:1.0.0-with-ListBundles-method-%s", catSrcImage, testOpmVersion),
10791081
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
10801082
SecurityContextConfig: v1alpha1.Restricted,
10811083
},
@@ -1126,8 +1128,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
11261128
if err != nil {
11271129
return err
11281130
}
1129-
existingSource.Spec.Image = catSrcImage + ":2.0.0-with-ListBundles-method"
1130-
1131+
existingSource.Spec.Image = fmt.Sprintf("%s:2.0.0-with-ListBundles-method-%s", catSrcImage, testOpmVersion)
11311132
source, err = crc.OperatorsV1alpha1().CatalogSources(source.GetNamespace()).Update(context.Background(), existingSource, metav1.UpdateOptions{})
11321133
return err
11331134
}).Should(Succeed())

test/e2e/e2e_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ var (
3838
catalogNamespace = flag.String(
3939
"catalogNamespace", "", "namespace where the global catalog content is stored")
4040

41-
communityOperators = flag.String(
42-
"communityOperators",
43-
"quay.io/operatorhubio/catalog:latest",
44-
"reference to upstream-community-operators image",
41+
opmVersion = flag.String(
42+
"opmVersion",
43+
"latest",
44+
"opm version used by test images",
4545
)
4646

4747
dummyImage = flag.String(
@@ -71,11 +71,11 @@ var (
7171
"Note that this flag will override the kubeconfig flag.",
7272
)
7373

74-
testdataDir = ""
75-
testNamespace = ""
76-
operatorNamespace = ""
77-
communityOperatorsImage = ""
78-
globalCatalogNamespace = ""
74+
testdataDir = ""
75+
testNamespace = ""
76+
operatorNamespace = ""
77+
testOpmVersion = ""
78+
globalCatalogNamespace = ""
7979
)
8080

8181
func TestEndToEnd(t *testing.T) {
@@ -104,7 +104,7 @@ var _ = BeforeSuite(func() {
104104

105105
testNamespace = *namespace
106106
operatorNamespace = *olmNamespace
107-
communityOperatorsImage = *communityOperators
107+
testOpmVersion = *opmVersion
108108
globalCatalogNamespace = *catalogNamespace
109109
testdataDir = *testdataPath
110110
deprovision = ctx.MustProvision(ctx.Ctx())

0 commit comments

Comments
 (0)