Skip to content

Commit ec521c6

Browse files
committed
Converted packagemanifest_e2e to ginkgo test
Signed-off-by: Harish <[email protected]>
1 parent 34d6563 commit ec521c6

9 files changed

+240
-211
lines changed

test/e2e/catalog_e2e_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var _ = Describe("Catalog", func() {
5656
crc := newCRClient()
5757

5858
catalogSourceName := genName("mock-ocs-")
59-
_, cleanupSource := createInternalCatalogSource(GinkgoT(), c, crc, catalogSourceName, operatorNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []v1alpha1.ClusterServiceVersion{csv})
59+
_, cleanupSource := createInternalCatalogSource(c, crc, catalogSourceName, operatorNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []v1alpha1.ClusterServiceVersion{csv})
6060
defer cleanupSource()
6161

6262
// ensure the mock catalog exists and has been synced by the catalog operator
@@ -132,7 +132,7 @@ var _ = Describe("Catalog", func() {
132132
}
133133

134134
// Create the initial catalog source
135-
createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, globalNS, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
135+
createInternalCatalogSource(c, crc, mainCatalogName, globalNS, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
136136

137137
// Attempt to get the catalog source before creating install plan
138138
_, err := fetchCatalogSourceOnStatus(crc, mainCatalogName, globalNS, catalogSourceRegistryPodSynced)
@@ -243,7 +243,7 @@ var _ = Describe("Catalog", func() {
243243
}
244244

245245
// Create the initial catalogsource
246-
createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, nil, []v1alpha1.ClusterServiceVersion{mainCSV})
246+
createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, nil, []v1alpha1.ClusterServiceVersion{mainCSV})
247247

248248
// Attempt to get the catalog source before creating install plan
249249
fetchedInitialCatalog, err := fetchCatalogSourceOnStatus(crc, mainCatalogName, testNamespace, catalogSourceRegistryPodSynced)
@@ -363,7 +363,7 @@ var _ = Describe("Catalog", func() {
363363
}
364364

365365
// Create the initial catalogsource
366-
_, cleanupSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, nil, []v1alpha1.ClusterServiceVersion{mainCSV})
366+
_, cleanupSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, nil, []v1alpha1.ClusterServiceVersion{mainCSV})
367367

368368
// Attempt to get the catalog source before creating install plan
369369
fetchedInitialCatalog, err := fetchCatalogSourceOnStatus(crc, mainCatalogName, testNamespace, catalogSourceRegistryPodSynced)
@@ -381,7 +381,7 @@ var _ = Describe("Catalog", func() {
381381
cleanupSource()
382382

383383
// create a catalog with the same name
384-
createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, append(mainManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{mainCSV, dependentCSV})
384+
createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, append(mainManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{mainCSV, dependentCSV})
385385

386386
// Create Subscription
387387
subscriptionName := genName("sub-")
@@ -465,8 +465,8 @@ var _ = Describe("Catalog", func() {
465465
}
466466

467467
// Create ConfigMap CatalogSources
468-
createInternalCatalogSource(GinkgoT(), c, crc, mainSourceName, testNamespace, append(mainManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{mainCSV, dependentCSV})
469-
createInternalCatalogSource(GinkgoT(), c, crc, replacementSourceName, testNamespace, append(replacementManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{replacementCSV, mainCSV, dependentCSV})
468+
createInternalCatalogSource(c, crc, mainSourceName, testNamespace, append(mainManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{mainCSV, dependentCSV})
469+
createInternalCatalogSource(c, crc, replacementSourceName, testNamespace, append(replacementManifests, dependentManifests...), []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{replacementCSV, mainCSV, dependentCSV})
470470

471471
// Wait for ConfigMap CatalogSources to be ready
472472
mainSource, err := fetchCatalogSourceOnStatus(crc, mainSourceName, testNamespace, catalogSourceRegistryPodSynced)
@@ -565,7 +565,7 @@ var _ = Describe("Catalog", func() {
565565

566566
c := newKubeClient()
567567
crc := newCRClient()
568-
_, cleanupSource := createInternalCatalogSource(GinkgoT(), c, crc, sourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []v1alpha1.ClusterServiceVersion{csv})
568+
_, cleanupSource := createInternalCatalogSource(c, crc, sourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []v1alpha1.ClusterServiceVersion{csv})
569569
defer cleanupSource()
570570

571571
// Wait for a new registry pod to be created

test/e2e/crd_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var _ = Describe("CRD Versions", func() {
7676
}
7777

7878
// Create the catalog sources
79-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
79+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
8080
defer cleanupMainCatalogSource()
8181

8282
// Attempt to get the catalog source before creating install plan

test/e2e/csv_e2e_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ var _ = Describe("CSV", func() {
968968

969969
deleted := make(chan struct{})
970970
go func() {
971+
defer GinkgoRecover()
971972
events := watcher.ResultChan()
972973
for {
973974
select {
@@ -1514,6 +1515,7 @@ var _ = Describe("CSV", func() {
15141515
quit := make(chan struct{})
15151516
defer close(quit)
15161517
go func() {
1518+
defer GinkgoRecover()
15171519
events := watcher.ResultChan()
15181520
for {
15191521
select {

test/e2e/installplan_e2e_test.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ var _ = Describe("Install Plan", func() {
9393

9494
// Create the catalog sources
9595
require.NotEqual(GinkgoT(), "", testNamespace)
96-
_, cleanupDependentCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, dependentCatalogName, testNamespace, dependentManifests, []apiextensions.CustomResourceDefinition{dependentCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentCSV})
96+
_, cleanupDependentCatalogSource := createInternalCatalogSource(c, crc, dependentCatalogName, testNamespace, dependentManifests, []apiextensions.CustomResourceDefinition{dependentCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentCSV})
9797
defer cleanupDependentCatalogSource()
9898

9999
// Attempt to get the catalog source before creating install plan
100100
_, err := fetchCatalogSourceOnStatus(crc, dependentCatalogName, testNamespace, catalogSourceRegistryPodSynced)
101101
require.NoError(GinkgoT(), err)
102102

103-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, nil, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
103+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, nil, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
104104
defer cleanupMainCatalogSource()
105105

106106
// Attempt to get the catalog source before creating install plan
@@ -265,7 +265,7 @@ var _ = Describe("Install Plan", func() {
265265

266266
// Create the catalog source
267267
mainCatalogSourceName := genName("mock-ocs-main-" + strings.ToLower(CurrentGinkgoTestDescription().TestText) + "-")
268-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{dependentCRD, mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentBetaCSV, dependentStableCSV, mainStableCSV, mainBetaCSV})
268+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{dependentCRD, mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentBetaCSV, dependentStableCSV, mainStableCSV, mainBetaCSV})
269269
defer cleanupCatalogSource()
270270

271271
// Attempt to get the catalog source before creating install plan(s)
@@ -390,7 +390,7 @@ var _ = Describe("Install Plan", func() {
390390

391391
// Create the catalog source
392392
mainCatalogSourceName := genName("mock-ocs-main-" + strings.ToLower(CurrentGinkgoTestDescription().TestText) + "-")
393-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{dependentCRD, mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentBetaCSV, dependentStableCSV, mainStableCSV, mainBetaCSV})
393+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{dependentCRD, mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentBetaCSV, dependentStableCSV, mainStableCSV, mainBetaCSV})
394394
defer cleanupCatalogSource()
395395

396396
// Attempt to get the catalog source before creating install plan(s)
@@ -764,7 +764,7 @@ var _ = Describe("Install Plan", func() {
764764

765765
// Create the catalog source
766766
mainCatalogSourceName := genName("mock-ocs-main-")
767-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{*tt.oldCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainStableCSV, mainBetaCSV})
767+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{*tt.oldCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainStableCSV, mainBetaCSV})
768768
defer cleanupCatalogSource()
769769

770770
// Attempt to get the catalog source before creating install plan(s)
@@ -966,7 +966,7 @@ var _ = Describe("Install Plan", func() {
966966

967967
// Create the catalog source
968968
mainCatalogSourceName := genName("mock-ocs-main-")
969-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{*tt.oldCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainStableCSV})
969+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, mainCatalogSourceName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{*tt.oldCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainStableCSV})
970970
defer cleanupCatalogSource()
971971

972972
// Attempt to get the catalog source before creating install plan(s)
@@ -1197,7 +1197,7 @@ var _ = Describe("Install Plan", func() {
11971197
},
11981198
}
11991199

1200-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
1200+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
12011201
defer cleanupMainCatalogSource()
12021202

12031203
// Attempt to get the catalog source before creating install plan
@@ -1384,7 +1384,7 @@ var _ = Describe("Install Plan", func() {
13841384
},
13851385
}
13861386

1387-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
1387+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
13881388
defer cleanupMainCatalogSource()
13891389

13901390
// Attempt to get the catalog source before creating install plan
@@ -1588,7 +1588,7 @@ var _ = Describe("Install Plan", func() {
15881588
DefaultChannelName: stableChannel,
15891589
},
15901590
}
1591-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
1591+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
15921592
defer cleanupMainCatalogSource()
15931593

15941594
// Attempt to get the catalog source before creating install plan
@@ -1795,7 +1795,7 @@ var _ = Describe("Install Plan", func() {
17951795
}
17961796

17971797
// Create the catalog sources
1798-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
1798+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
17991799
defer cleanupMainCatalogSource()
18001800

18011801
// Attempt to get the catalog source before creating install plan
@@ -1979,7 +1979,7 @@ var _ = Describe("Install Plan", func() {
19791979
}
19801980

19811981
// Create the catalog sources
1982-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{updatedCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
1982+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{updatedCRD}, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
19831983
defer cleanupMainCatalogSource()
19841984

19851985
// Attempt to get the catalog source before creating install plan
@@ -2115,7 +2115,7 @@ var _ = Describe("Install Plan", func() {
21152115

21162116
// Create CatalogSource
21172117
mainCatalogSourceName := genName("nginx-catalog")
2118-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogSourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []operatorsv1alpha1.ClusterServiceVersion{stableCSV})
2118+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, mainCatalogSourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []operatorsv1alpha1.ClusterServiceVersion{stableCSV})
21192119
defer cleanupCatalogSource()
21202120

21212121
// Attempt to get CatalogSource
@@ -2224,6 +2224,7 @@ var _ = Describe("Install Plan", func() {
22242224
done := make(chan struct{})
22252225
errExit := make(chan error)
22262226
go func() {
2227+
defer GinkgoRecover()
22272228
for {
22282229
select {
22292230
case evt, ok := <-crWatcher.ResultChan():
@@ -2363,7 +2364,7 @@ var _ = Describe("Install Plan", func() {
23632364
c := newKubeClient()
23642365
crc := newCRClient()
23652366
catalogSourceName := genName("mock-nginx-")
2366-
_, cleanupCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, catalogSourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []operatorsv1alpha1.ClusterServiceVersion{csv})
2367+
_, cleanupCatalogSource := createInternalCatalogSource(c, crc, catalogSourceName, testNamespace, manifests, []apiextensions.CustomResourceDefinition{crd}, []operatorsv1alpha1.ClusterServiceVersion{csv})
23672368
defer cleanupCatalogSource()
23682369

23692370
// Attempt to get the catalog source before creating install plan
@@ -2544,7 +2545,7 @@ var _ = Describe("Install Plan", func() {
25442545
}
25452546

25462547
// Create the dependent catalog source
2547-
_, cleanupDependentCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, dependentCatalogName, ns.GetName(), dependentManifests, []apiextensions.CustomResourceDefinition{dependentCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentCSV})
2548+
_, cleanupDependentCatalogSource := createInternalCatalogSource(c, crc, dependentCatalogName, ns.GetName(), dependentManifests, []apiextensions.CustomResourceDefinition{dependentCRD}, []operatorsv1alpha1.ClusterServiceVersion{dependentCSV})
25482549
defer cleanupDependentCatalogSource()
25492550

25502551
// Attempt to get the catalog source before creating install plan
@@ -2556,6 +2557,7 @@ var _ = Describe("Install Plan", func() {
25562557
for i := 0; i < 4; i++ { // Creating more increases the odds that the race condition will be triggered
25572558
wg.Add(1)
25582559
go func(i int) {
2560+
defer GinkgoRecover()
25592561
// Create a CatalogSource pointing to the grpc pod
25602562
addressSource := &operatorsv1alpha1.CatalogSource{
25612563
TypeMeta: metav1.TypeMeta{
@@ -2581,7 +2583,7 @@ var _ = Describe("Install Plan", func() {
25812583
wg.Wait()
25822584

25832585
// Create the main catalog source
2584-
_, cleanupMainCatalogSource := createInternalCatalogSource(GinkgoT(), c, crc, mainCatalogName, ns.GetName(), mainManifests, nil, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
2586+
_, cleanupMainCatalogSource := createInternalCatalogSource(c, crc, mainCatalogName, ns.GetName(), mainManifests, nil, []operatorsv1alpha1.ClusterServiceVersion{mainCSV})
25852587
defer cleanupMainCatalogSource()
25862588

25872589
// Attempt to get the catalog source before creating install plan

0 commit comments

Comments
 (0)