Skip to content

Commit 237427b

Browse files
authored
Port Kuttl E2E tests to Ginkgo (#877)
Signed-off-by: Jonathan West <jonwest@redhat.com>
1 parent 1414aa3 commit 237427b

File tree

168 files changed

+22981
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+22981
-152
lines changed

.gitleaks.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[allowlist]
2+
description = "Global Allowlist"
3+
4+
paths = [
5+
'''test/openshift/e2e/ginkgo/parallel/1-005_validate_route_tls_test\.go$''',
6+
'''test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test\.go$''',
7+
]
8+

Makefile

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,31 @@ test-gitopsservice-nondefault:
154154
test: manifests generate fmt vet ## Run unit tests.
155155
go test `go list ./... | grep -v test` -coverprofile cover.out
156156

157+
158+
.PHONY: e2e-tests-ginkgo
159+
e2e-tests-ginkgo: e2e-tests-sequential-ginkgo e2e-tests-parallel-ginkgo ## Runs kuttl e2e sequential and parallel tests
160+
161+
.PHONY: e2e-tests-sequential-ginkgo
162+
e2e-tests-sequential-ginkgo: ginkgo ## Runs kuttl e2e sequential tests
163+
@echo "Running GitOps Operator sequential Ginkgo E2E tests..."
164+
$(GINKGO_CLI) -v --trace --timeout 90m -r ./test/openshift/e2e/ginkgo/sequential
165+
166+
.PHONY: e2e-tests-parallel-ginkgo ## Runs kuttl e2e parallel tests, (Defaults to 5 runs at a time)
167+
e2e-tests-parallel-ginkgo: ginkgo
168+
@echo "Running GitOps Operator parallel Ginkgo E2E tests..."
169+
$(GINKGO_CLI) -p -v -procs=5 --trace --timeout 30m -r ./test/openshift/e2e/ginkgo/parallel
170+
157171
.PHONY: e2e-tests-sequential
158-
e2e-tests-sequential: ## Runs kuttl e2e sequentail tests
159-
@echo "Running GitOps Operator sequential E2E tests..."
160-
. ./scripts/run-kuttl-tests.sh sequential
172+
e2e-tests-sequential:
173+
CI=prow make e2e-tests-sequential-ginkgo ## Runs kuttl e2e sequentail tests
174+
# @echo "Running GitOps Operator sequential E2E tests..."
175+
# . ./scripts/run-kuttl-tests.sh sequential
161176

162177
.PHONY: e2e-tests-parallel ## Runs kuttl e2e parallel tests, (Defaults to 5 runs at a time)
163-
e2e-tests-parallel:
164-
@echo "Running GitOps Operator parallel E2E tests..."
165-
. ./scripts/run-kuttl-tests.sh parallel
178+
e2e-tests-parallel:
179+
CI=prow make e2e-tests-parallel-ginkgo
180+
# @echo "Running GitOps Operator parallel E2E tests..."
181+
# . ./scripts/run-kuttl-tests.sh parallel
166182

167183
.PHONY: e2e-non-olm-tests-sequential
168184
e2e-non-olm-tests-sequential: ## Runs kuttl non-olm e2e sequentail tests
@@ -187,7 +203,7 @@ build: generate fmt vet ## Build manager binary.
187203

188204
.PHONY: run
189205
run: manifests generate fmt vet ## Run a controller from your host.
190-
REDIS_CONFIG_PATH="build/redis" go run ./cmd/main.go
206+
CLUSTER_SCOPED_ARGO_ROLLOUTS_NAMESPACES=argo-rollouts,test-rom-ns-1,rom-ns-1,openshift-gitops ARGOCD_CLUSTER_CONFIG_NAMESPACES=openshift-gitops REDIS_CONFIG_PATH="build/redis" go run ./cmd/main.go
191207

192208
.PHONY: docker-build
193209
docker-build: test ## Build docker image with the manager.
@@ -258,6 +274,12 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
258274
kustomize: ## Download kustomize locally if necessary.
259275
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.2)
260276

277+
GINKGO_CLI = $(shell pwd)/bin/ginkgo
278+
.PHONY: ginkgo
279+
ginkgo: ## Download ginkgo locally if necessary.
280+
$(call go-get-tool,$(GINKGO_CLI),github.com/onsi/ginkgo/v2/ginkgo@v2.22.2)
281+
282+
261283
# go-get-tool will 'go install' any package $2 and install it to $1.
262284
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
263285
define go-get-tool

go.mod

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ toolchain go1.22.5
77
require (
88
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250429111039-a07ef1782da6
99
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250522132021-d72738feaad2
10+
github.com/argoproj/argo-cd/v2 v2.12.10
11+
github.com/argoproj/gitops-engine v0.7.1-0.20250129155113-faf5a4e5c37d
1012
github.com/go-logr/logr v1.4.2
1113
github.com/google/go-cmp v0.6.0
1214
github.com/hashicorp/go-version v1.6.0
13-
github.com/onsi/ginkgo v1.16.5
14-
github.com/onsi/gomega v1.34.0
15+
github.com/onsi/ginkgo/v2 v2.22.2
16+
github.com/onsi/gomega v1.36.2
1517
github.com/openshift/api v0.0.0-20240906151052-5d963dce87aa
1618
github.com/operator-framework/api v0.17.5
1719
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.73.2
@@ -29,68 +31,140 @@ require (
2931
)
3032

3133
require (
32-
github.com/argoproj/argo-cd/v2 v2.12.10 // indirect
34+
cloud.google.com/go/compute/metadata v0.3.0 // indirect
35+
dario.cat/mergo v1.0.0 // indirect
36+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
37+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
38+
github.com/Masterminds/semver/v3 v3.2.1 // indirect
39+
github.com/Microsoft/go-winio v0.6.1 // indirect
40+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
41+
github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1 // indirect
3342
github.com/beorn7/perks v1.0.1 // indirect
3443
github.com/blang/semver/v4 v4.0.0 // indirect
44+
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
45+
github.com/bombsimon/logrusr/v2 v2.0.1 // indirect
46+
github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 // indirect
3547
github.com/cert-manager/cert-manager v1.14.4 // indirect
3648
github.com/cespare/xxhash/v2 v2.3.0 // indirect
49+
github.com/chai2010/gettext-go v1.0.2 // indirect
50+
github.com/cloudflare/circl v1.3.7 // indirect
51+
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
3752
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
53+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
54+
github.com/distribution/reference v0.5.0 // indirect
3855
github.com/dlclark/regexp2 v1.11.2 // indirect
3956
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
57+
github.com/emirpasic/gods v1.18.1 // indirect
4058
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
4159
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
60+
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
61+
github.com/fatih/camelcase v1.0.0 // indirect
4262
github.com/fsnotify/fsnotify v1.7.0 // indirect
63+
github.com/fvbommel/sortorder v1.1.0 // indirect
64+
github.com/go-errors/errors v1.4.2 // indirect
65+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
66+
github.com/go-git/go-billy/v5 v5.6.1 // indirect
67+
github.com/go-git/go-git/v5 v5.13.1 // indirect
4368
github.com/go-logr/zapr v1.3.0 // indirect
4469
github.com/go-openapi/jsonpointer v0.21.0 // indirect
4570
github.com/go-openapi/jsonreference v0.21.0 // indirect
4671
github.com/go-openapi/swag v0.23.0 // indirect
72+
github.com/go-redis/cache/v9 v9.0.0 // indirect
73+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
4774
github.com/gobwas/glob v0.2.3 // indirect
4875
github.com/gogo/protobuf v1.3.2 // indirect
76+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
4977
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5078
github.com/golang/protobuf v1.5.4 // indirect
79+
github.com/google/btree v1.1.2 // indirect
5180
github.com/google/gnostic-models v0.6.8 // indirect
81+
github.com/google/go-github/v53 v53.2.0 // indirect
82+
github.com/google/go-querystring v1.1.0 // indirect
5283
github.com/google/gofuzz v1.2.0 // indirect
84+
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
85+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
5386
github.com/google/uuid v1.6.0 // indirect
87+
github.com/gorilla/websocket v1.5.0 // indirect
88+
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
5489
github.com/imdario/mergo v0.3.16 // indirect
90+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
91+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
92+
github.com/jonboulle/clockwork v0.2.2 // indirect
5593
github.com/josharian/intern v1.0.0 // indirect
5694
github.com/json-iterator/go v1.1.12 // indirect
95+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
96+
github.com/kevinburke/ssh_config v1.2.0 // indirect
5797
github.com/klauspost/compress v1.17.11 // indirect
98+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
5899
github.com/mailru/easyjson v0.7.7 // indirect
100+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
101+
github.com/moby/spdystream v0.2.0 // indirect
102+
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
59103
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
60104
github.com/modern-go/reflect2 v1.0.2 // indirect
105+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
61106
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
62-
github.com/nxadm/tail v1.4.8 // indirect
107+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
108+
github.com/opencontainers/go-digest v1.0.0 // indirect
109+
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
63110
github.com/openshift/client-go v0.0.0-20200325131901-f7baeb993edb // indirect
111+
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
112+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
113+
github.com/pjbgf/sha1cd v0.3.0 // indirect
64114
github.com/pkg/errors v0.9.1 // indirect
65115
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
66116
github.com/prometheus/client_golang v1.21.0 // indirect
67117
github.com/prometheus/client_model v0.6.1 // indirect
68118
github.com/prometheus/common v0.62.0 // indirect
69119
github.com/prometheus/procfs v0.15.1 // indirect
120+
github.com/redis/go-redis/v9 v9.0.5 // indirect
121+
github.com/robfig/cron/v3 v3.0.1 // indirect
122+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
123+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
70124
github.com/sethvargo/go-password v0.3.1 // indirect
71125
github.com/sirupsen/logrus v1.9.3 // indirect
126+
github.com/skeema/knownhosts v1.3.0 // indirect
127+
github.com/spf13/cobra v1.8.0 // indirect
72128
github.com/spf13/pflag v1.0.5 // indirect
129+
github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
130+
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
131+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
132+
github.com/xanzy/ssh-agent v0.3.3 // indirect
133+
github.com/xlab/treeprint v1.2.0 // indirect
134+
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
73135
go.uber.org/multierr v1.11.0 // indirect
74136
golang.org/x/crypto v0.31.0 // indirect
75137
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
76138
golang.org/x/net v0.33.0 // indirect
77139
golang.org/x/oauth2 v0.24.0 // indirect
140+
golang.org/x/sync v0.10.0 // indirect
78141
golang.org/x/sys v0.28.0 // indirect
79142
golang.org/x/term v0.27.0 // indirect
80143
golang.org/x/text v0.21.0 // indirect
81144
golang.org/x/time v0.5.0 // indirect
145+
golang.org/x/tools v0.28.0 // indirect
82146
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
147+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
148+
google.golang.org/grpc v1.60.1 // indirect
83149
google.golang.org/protobuf v1.36.1 // indirect
84150
gopkg.in/inf.v0 v0.9.1 // indirect
85-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
151+
gopkg.in/warnings.v0 v0.1.2 // indirect
86152
gopkg.in/yaml.v2 v2.4.0 // indirect
87153
gopkg.in/yaml.v3 v3.0.1 // indirect
154+
k8s.io/apiserver v0.29.6 // indirect
155+
k8s.io/cli-runtime v0.29.6 // indirect
88156
k8s.io/component-base v0.29.6 // indirect
157+
k8s.io/component-helpers v0.29.6 // indirect
89158
k8s.io/klog/v2 v2.120.1 // indirect
90159
k8s.io/kube-aggregator v0.29.6 // indirect
91160
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
161+
k8s.io/kubectl v0.29.6 // indirect
162+
k8s.io/kubernetes v1.29.6 // indirect
163+
oras.land/oras-go/v2 v2.3.0 // indirect
92164
sigs.k8s.io/gateway-api v1.0.0 // indirect
93165
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
166+
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
167+
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
94168
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
95169
)
96170

0 commit comments

Comments
 (0)