Skip to content

Commit dac494c

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 23e1f17 commit dac494c

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

test/e2e/catalog_e2e_test.go

+6-5
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("%s/test-catalog:e2e", testClusterRegistry)
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", catSrcImage),
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", catSrcImage)
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

+12-12
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ 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",
45-
)
46-
4741
dummyImage = flag.String(
4842
"dummyImage",
4943
"bitnami/nginx:latest",
@@ -62,6 +56,12 @@ var (
6256
"configures where to find the testdata directory",
6357
)
6458

59+
clusterRegistry = flag.String(
60+
"cluster-registry",
61+
"localhost:5001",
62+
"set cluster registry url (default: localhost:5001)",
63+
)
64+
6565
kubeconfigRootDir = flag.String(
6666
"kubeconfig-root",
6767
"",
@@ -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+
globalCatalogNamespace = ""
78+
testClusterRegistry = ""
7979
)
8080

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

105105
testNamespace = *namespace
106106
operatorNamespace = *olmNamespace
107-
communityOperatorsImage = *communityOperators
108107
globalCatalogNamespace = *catalogNamespace
109108
testdataDir = *testdataPath
109+
testClusterRegistry = *clusterRegistry
110110
deprovision = ctx.MustProvision(ctx.Ctx())
111111
ctx.MustInstall(ctx.Ctx())
112112

test/e2e/util.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ func catalogSourceRegistryPodSynced() func(catalog *operatorsv1alpha1.CatalogSou
359359
state = connState.LastObservedState
360360
}
361361
if state != lastState {
362-
fmt.Printf("waiting %s for catalog pod %s/%s to be available (for sync) - %s\n", time.Since(lastTime), catalog.GetNamespace(), catalog.GetName(), state)
362+
ctx.Ctx().Logf("waiting %s for catalog pod %s/%s to be available (for sync) - %s\n", time.Since(lastTime), catalog.GetNamespace(), catalog.GetName(), state)
363363
lastState = state
364364
lastTime = time.Now()
365365
}
366366
if registry != nil && connState != nil && !connState.LastConnectTime.IsZero() && connState.LastObservedState == "READY" {
367-
fmt.Printf("probing catalog %s pod with address %s\n", catalog.GetName(), registry.Address())
367+
ctx.Ctx().Logf("probing catalog %s pod with address %s\n", catalog.GetName(), registry.Address())
368368
return registryPodHealthy(registry.Address())
369369
}
370370
return false

0 commit comments

Comments
 (0)