Skip to content

Commit 3d31160

Browse files
committed
upgraded ginkgo on tests to ginkgo 2.0
1 parent fbab17b commit 3d31160

13 files changed

+28
-26
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ENVTEST_K8S_VERSION = 1.21
1414
.PHONY:ginkgo
1515
ginkgo: # Make sure ginkgo is in $GOPATH/bin
1616
go get github.com/onsi/ginkgo/ginkgo
17+
go get github.com/onsi/ginkgo/ginkgo/v2
1718
go get github.com/onsi/gomega/...
1819

1920
# VERSION defines the project version for the bundle.
@@ -290,15 +291,17 @@ catalog-push: ## Push a catalog image.
290291
$(MAKE) docker-push IMG=$(CATALOG_IMG)
291292

292293
S3_BUCKET := $(shell cat $(OADP_S3_BUCKET) | awk '/velero-bucket-name/ {gsub(/"/, "", $$2);gsub(/}/,""); print $$2}')
294+
TEST_FILTER := $(shell echo '!aws&&!gcp&&!azure' | sed -r "s/[&]*[!]$(CLUSTER_PROFILE)|[!]$(CLUSTER_PROFILE)[&]*//")
293295
SETTINGS_TMP=/tmp/test-settings
294296
test-e2e:
295297
mkdir -p $(SETTINGS_TMP)
296298
PROVIDER="$(PROVIDER)" BUCKET="$(S3_BUCKET)" REGION="$(REGION)" SECRET="$(CREDS_SECRET_REF)" TMP_DIR=$(SETTINGS_TMP) /bin/bash tests/e2e/scripts/aws_settings.sh
297-
ginkgo -mod=mod tests/e2e/ -- -cloud=$(OADP_AWS_CRED_FILE) \
299+
ginkgo run -mod=mod tests/e2e/ -- -cloud=$(OADP_AWS_CRED_FILE) \
298300
-velero_namespace=$(OADP_TEST_NAMESPACE) \
299301
-settings=$(SETTINGS_TMP)/awscreds \
300302
-velero_instance_name=$(VELERO_INSTANCE_NAME) \
301303
-timeout_multiplier=$(E2E_TIMEOUT_MULTIPLIER) \
302-
-cluster_profile=$(CLUSTER_PROFILE)
304+
-cluster_profile=$(CLUSTER_PROFILE) \
305+
--ginkgo.label-filter=$(TEST_FILTER)
303306
test-e2e-cleanup:
304307
rm -rf $(SETTINGS_TMP)

build/ci-Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# TODO! Find a real ubi8 image for golang 1.16
33
FROM quay.io/app-sre/boilerplate:image-v2.1.0 as builder
44

5-
RUN go get -u github.com/onsi/ginkgo/ginkgo
5+
RUN go get -u github.com/onsi/ginkgo/ginkgo && \
6+
go get -u github.com/onsi/ginkgo/ginkgo/v2
67
RUN go get github.com/onsi/gomega/...
78

89
WORKDIR /go/src/github.com/openshift/oadp-operator

build/custom-ci-Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM openshift/origin-release:golang-1.16
22
RUN yum -y install epel-release --disablerepo=epel && yum clean all
33
RUN yum -y install make
4-
RUN go get -u github.com/onsi/ginkgo/ginkgo
4+
RUN go get -u github.com/onsi/ginkgo/ginkgo && \
5+
go get -u github.com/onsi/ginkgo/ginkgo/v2
56
RUN go get github.com/onsi/gomega/...
67
RUN chmod g+rw /etc/passwd
78
ENV LC_ALL=en_US.utf-8 LANG=en_US.utf-8

docs/developer/TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Install Ginkgo
66
```bash
7-
$ go get -u github.com/onsi/ginkgo/ginkgo
7+
$ go get -u github.com/onsi/ginkgo/ginkgo/v2
88
```
99

1010
### Setup backup storage configuration

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ require (
77
github.com/go-logr/logr v0.4.0
88
github.com/google/uuid v1.1.2
99
github.com/onsi/ginkgo v1.16.4
10-
github.com/onsi/gomega v1.16.0
10+
github.com/onsi/ginkgo/v2 v2.1.1
11+
github.com/onsi/gomega v1.17.0
1112
github.com/openshift/api v0.0.0-20210805075156-d8fab4513288
1213
github.com/operator-framework/api v0.10.7
1314
github.com/operator-framework/operator-lib v0.9.0

go.sum

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
383383
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
384384
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
385385
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
386+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
386387
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
387388
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
388389
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -571,6 +572,8 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
571572
github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
572573
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
573574
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
575+
github.com/onsi/ginkgo/v2 v2.1.1 h1:LCnPB85AvFNr91s0B2aDzEiiIg6MUwLYbryC1NSlWi8=
576+
github.com/onsi/ginkgo/v2 v2.1.1/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
574577
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
575578
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
576579
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -580,8 +583,8 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
580583
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
581584
github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
582585
github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
583-
github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
584-
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
586+
github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE=
587+
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
585588
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
586589
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
587590
github.com/openshift/api v0.0.0-20210805075156-d8fab4513288 h1:Yw96Z8gygCXxjeMTm55gGsTNxwnJkr6L2Baf3NsUQFU=

tests/e2e/apps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"os"
88

9-
"github.com/onsi/ginkgo"
9+
"github.com/onsi/ginkgo/v2"
1010
ocpappsv1 "github.com/openshift/api/apps/v1"
1111
appsv1 "k8s.io/api/apps/v1"
1212

tests/e2e/backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/onsi/ginkgo"
7+
"github.com/onsi/ginkgo/v2"
88
velero "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010
"k8s.io/apimachinery/pkg/util/wait"

tests/e2e/backup_restore_suite_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import (
77
"time"
88

99
"github.com/google/uuid"
10-
. "github.com/onsi/ginkgo"
11-
. "github.com/onsi/ginkgo/extensions/table"
10+
. "github.com/onsi/ginkgo/v2"
1211
. "github.com/onsi/gomega"
1312
"sigs.k8s.io/controller-runtime/pkg/client"
1413
)
@@ -79,13 +78,9 @@ var _ = Describe("AWS backup restore tests", func() {
7978
}
8079

8180
if brCase.BackupRestoreType == csi {
82-
if clusterProfile == "aws" {
83-
log.Printf("Creating VolumeSnapshot for CSI backuprestore of %s", brCase.Name)
84-
err = installApplication(dpaCR.Client, "./sample-applications/gp2-csi/volumeSnapshotClass.yaml")
85-
Expect(err).ToNot(HaveOccurred())
86-
} else {
87-
Skip("CSI testing is not provided for this cluster provider.")
88-
}
81+
log.Printf("Creating VolumeSnapshot for CSI backuprestore of %s", brCase.Name)
82+
err = installApplication(dpaCR.Client, "./sample-applications/gp2-csi/volumeSnapshotClass.yaml")
83+
Expect(err).ToNot(HaveOccurred())
8984
}
9085

9186
if dpaCR.CustomResource.Spec.BackupImages == nil || *dpaCR.CustomResource.Spec.BackupImages {
@@ -170,7 +165,7 @@ var _ = Describe("AWS backup restore tests", func() {
170165
}
171166

172167
},
173-
Entry("MSSQL application CSI", BackupRestoreCase{
168+
Entry("MSSQL application CSI", Label("aws"), BackupRestoreCase{
174169
ApplicationTemplate: "./sample-applications/mssql-persistent/mssql-persistent-csi-template.yaml",
175170
ApplicationNamespace: "mssql-persistent",
176171
Name: "mssql-e2e",

tests/e2e/dpa_deployment_suite_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
"k8s.io/apimachinery/pkg/api/resource"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010

11-
. "github.com/onsi/ginkgo"
12-
. "github.com/onsi/ginkgo/extensions/table"
11+
. "github.com/onsi/ginkgo/v2"
1312
. "github.com/onsi/gomega"
1413
oadpv1alpha1 "github.com/openshift/oadp-operator/api/v1alpha1"
1514
velero "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"

0 commit comments

Comments
 (0)