Skip to content

Commit 104feed

Browse files
committed
cleanup
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
1 parent dde993b commit 104feed

14 files changed

+39
-257
lines changed

.github/workflows/e2e.yaml

+18-77
Original file line numberDiff line numberDiff line change
@@ -12,82 +12,6 @@ concurrency:
1212

1313
jobs:
1414
e2e-tests:
15-
name: End-to-end tests ${{ matrix.group }} on K8s ${{ matrix.kube-version }}
16-
runs-on: ubuntu-22.04
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
# The e2e tests are run on the lowest and highest supported k8s version.
21-
# All Kubernetes version in between expose the same APIs, hence the operator
22-
# should be compatible with them.
23-
kube-version:
24-
- "1.23"
25-
- "1.29"
26-
group: []
27-
# - e2e
28-
# - e2e-instrumentation
29-
# - e2e-upgrade
30-
# - e2e-autoscale
31-
# - e2e-pdb
32-
# - e2e-opampbridge
33-
# - e2e-prometheuscr
34-
# - e2e-targetallocator
35-
# - e2e-multi-instrumentation
36-
include:
37-
- group: e2e-prometheuscr
38-
setup: "prepare-e2e-with-featuregates FEATUREGATES=+operator.observability.prometheus"
39-
- group: e2e-multi-instrumentation
40-
setup: "prepare-e2e-with-featuregates FEATUREGATES=+operator.autoinstrumentation.multi-instrumentation"
41-
42-
steps:
43-
- name: Check out code into the Go module directory
44-
uses: actions/checkout@v4
45-
46-
- name: Set up Go
47-
uses: actions/setup-go@v5
48-
with:
49-
go-version: "~1.21.3"
50-
51-
- name: Cache tools
52-
uses: actions/cache@v4
53-
with:
54-
path: bin
55-
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
56-
57-
- name: Install tools
58-
run: make install-tools
59-
60-
- name: "run tests"
61-
env:
62-
KUBE_VERSION: ${{ matrix.kube-version }}
63-
run: |
64-
make ${{ matrix.setup != '' && matrix.setup || 'prepare-e2e' }} KUBE_VERSION=$KUBE_VERSION VERSION=e2e
65-
make ${{ matrix.group }}
66-
67-
- name: "log operator if failed"
68-
if: ${{ failure() }}
69-
env:
70-
KUBE_VERSION: ${{ matrix.kube-version }}
71-
run: make e2e-log-operator KUBE_VERSION=$KUBE_VERSION
72-
73-
e2e-tests-check:
74-
runs-on: ubuntu-22.04
75-
if: always()
76-
needs: [e2e-tests]
77-
steps:
78-
- name: Print result
79-
run: echo ${{ needs.e2e-tests.result }}
80-
- name: Interpret result
81-
run: |
82-
if [[ success == ${{ needs.e2e-tests.result }} ]]
83-
then
84-
echo "All matrix jobs passed!"
85-
else
86-
echo "One or more matrix jobs failed."
87-
false
88-
fi
89-
90-
chainsaw-tests:
9115
runs-on: ubuntu-22.04
9216
strategy:
9317
fail-fast: false
@@ -141,11 +65,28 @@ jobs:
14165
KUBE_VERSION: ${{ matrix.kube-version }}
14266
run: |
14367
set -e
144-
make chainsaw-${{ matrix.group }}
68+
make ${{ matrix.group }}
14569
- name: "log operator if failed"
14670
if: ${{ failure() }}
14771
env:
14872
KUBE_VERSION: ${{ matrix.kube-version }}
14973
run: |
15074
set -e
15175
make e2e-log-operator KUBE_VERSION=$KUBE_VERSION
76+
77+
e2e-tests-check:
78+
runs-on: ubuntu-22.04
79+
if: always()
80+
needs: [e2e-tests]
81+
steps:
82+
- name: Print result
83+
run: echo ${{ needs.e2e-tests.result }}
84+
- name: Interpret result
85+
run: |
86+
if [[ success == ${{ needs.e2e-tests.result }} ]]
87+
then
88+
echo "All matrix jobs passed!"
89+
else
90+
echo "One or more matrix jobs failed."
91+
false
92+
fi

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ KUBEBUILDER_ASSETS=$(./bin/setup-envtest use -p path 1.23) go test ./pkg...
118118

119119
### End to end tests
120120

121-
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`kuttl`](https://kuttl.dev). Refer to their documentation for installation instructions.
121+
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`chainsaw`](https://kyverno.github.io/chainsaw). Refer to their documentation for installation instructions.
122122

123123
Once they are installed, the tests can be executed with `make prepare-e2e`, which will build an image to use with the tests, followed by `make e2e`. Each call to the `e2e` target will setup a fresh `kind` cluster, making it safe to be executed multiple times with a single `prepare-e2e` step.
124124

125-
The tests are located under `tests/e2e` and are written to be used with `kuttl`. Refer to their documentation to understand how tests are written.
125+
The tests are located under `tests/e2e` and are written to be used with `chainsaw`. Refer to their documentation to understand how tests are written.
126126

127127
To evert the changes made by the `make prepare-e2e` run `make reset`.
128128

@@ -133,7 +133,7 @@ To install the OpenTelemetry operator, please follow the instructions in [Opera
133133

134134
Once the operator is installed, the tests can be executed using `make e2e-openshift`, which will call to the `e2e-openshift` target. Note that `kind` is disabled for the TestSuite as the requirement is to use an OpenShift cluster for these test cases.
135135

136-
The tests are located under `tests/e2e-openshift` and are written to be used with `kuttl`.
136+
The tests are located under `tests/e2e-openshift` and are written to be used with `chainsaw`.
137137

138138
### Undeploying the operator from the local cluster
139139

Makefile

+18-82
Original file line numberDiff line numberDiff line change
@@ -195,44 +195,20 @@ lint: golangci-lint
195195
generate: controller-gen
196196
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
197197

198-
#########
199-
# KUTTL #
200-
#########
201-
202198
# end-to-tests
203199
.PHONY: e2e
204200
e2e:
205-
$(KUTTL) test
206-
207-
# instrumentation end-to-tests
208-
.PHONY: e2e-instrumentation
209-
e2e-instrumentation:
210-
$(KUTTL) test --config kuttl-test-instrumentation.yaml
211-
212-
# end-to-end-test for PrometheusCR E2E tests
213-
.PHONY: e2e-prometheuscr
214-
e2e-prometheuscr:
215-
$(KUTTL) test --config kuttl-test-prometheuscr.yaml
216-
217-
# end-to-end-test for testing upgrading
218-
.PHONY: e2e-upgrade
219-
e2e-upgrade: undeploy
220-
$(KUTTL) test --config kuttl-test-upgrade.yaml
201+
chainsaw test --test-dir ./tests/e2e
221202

222203
# end-to-end-test for testing autoscale
223204
.PHONY: e2e-autoscale
224205
e2e-autoscale:
225-
$(KUTTL) test --config kuttl-test-autoscale.yaml
226-
227-
# end-to-end-test for testing pdb support
228-
.PHONY: e2e-pdb
229-
e2e-pdb:
230-
$(KUTTL) test --config kuttl-test-pdb.yaml
206+
chainsaw test --test-dir ./tests/e2e-autoscale
231207

232-
# end-to-end-test for testing OpenShift cases
233-
.PHONY: e2e-openshift
234-
e2e-openshift:
235-
$(KUTTL) test --config kuttl-test-openshift.yaml
208+
# instrumentation end-to-tests
209+
.PHONY: e2e-instrumentation
210+
e2e-instrumentation:
211+
chainsaw test --test-dir ./tests/e2e-instrumentation
236212

237213
.PHONY: e2e-log-operator
238214
e2e-log-operator:
@@ -242,72 +218,38 @@ e2e-log-operator:
242218
# end-to-tests for multi-instrumentation
243219
.PHONY: e2e-multi-instrumentation
244220
e2e-multi-instrumentation:
245-
$(KUTTL) test --config kuttl-test-multi-instr.yaml
221+
chainsaw test --test-dir ./tests/e2e-multi-instrumentation
246222

247223
# OpAMPBridge CR end-to-tests
248224
.PHONY: e2e-opampbridge
249225
e2e-opampbridge:
250-
$(KUTTL) test --config kuttl-test-opampbridge.yaml
251-
252-
# Target allocator end-to-tests
253-
.PHONY: e2e-targetallocator
254-
e2e-targetallocator:
255-
$(KUTTL) test --config kuttl-test-targetallocator.yaml
256-
257-
############
258-
# CHAINSAW #
259-
############
260-
261-
# end-to-tests
262-
.PHONY: chainsaw-e2e
263-
chainsaw-e2e:
264-
chainsaw test --test-dir ./tests/e2e
265-
266-
# end-to-end-test for testing autoscale
267-
.PHONY: chainsaw-e2e-autoscale
268-
chainsaw-e2e-autoscale:
269-
chainsaw test --test-dir ./tests/e2e-autoscale
270-
271-
# instrumentation end-to-tests
272-
.PHONY: chainsaw-e2e-instrumentation
273-
chainsaw-e2e-instrumentation:
274-
chainsaw test --test-dir ./tests/e2e-instrumentation
275-
276-
# end-to-tests for multi-instrumentation
277-
.PHONY: chainsaw-e2e-multi-instrumentation
278-
chainsaw-e2e-multi-instrumentation:
279-
chainsaw test --test-dir ./tests/e2e-multi-instrumentation
280-
281-
# OpAMPBridge CR end-to-tests
282-
.PHONY: chainsaw-e2e-opampbridge
283-
chainsaw-e2e-opampbridge:
284226
chainsaw test --test-dir ./tests/e2e-opampbridge
285227

286228
# end-to-end-test for testing pdb support
287-
.PHONY: chainsaw-e2e-pdb
288-
chainsaw-e2e-pdb:
229+
.PHONY: e2e-pdb
230+
e2e-pdb:
289231
chainsaw test --test-dir ./tests/e2e-pdb
290232

291233
# end-to-end-test for PrometheusCR E2E tests
292-
.PHONY: chainsaw-e2e-prometheuscr
293-
chainsaw-e2e-prometheuscr:
234+
.PHONY: e2e-prometheuscr
235+
e2e-prometheuscr:
294236
chainsaw test --test-dir ./tests/e2e-prometheuscr
295237

296238
# Target allocator end-to-tests
297-
.PHONY: chainsaw-e2e-targetallocator
298-
chainsaw-e2e-targetallocator:
239+
.PHONY: e2e-targetallocator
240+
e2e-targetallocator:
299241
chainsaw test --test-dir ./tests/e2e-targetallocator
300242

301243
# end-to-end-test for testing upgrading
302-
.PHONY: chainsaw-e2e-upgrade
303-
chainsaw-e2e-upgrade: undeploy
244+
.PHONY: e2e-upgrade
245+
e2e-upgrade: undeploy
304246
chainsaw test --test-dir ./tests/e2e-upgrade
305247

306248
.PHONY: prepare-e2e
307-
prepare-e2e: kuttl set-image-controller add-image-targetallocator add-image-opampbridge container container-target-allocator container-operator-opamp-bridge start-kind cert-manager install-metrics-server install-targetallocator-prometheus-crds load-image-all deploy
249+
prepare-e2e: set-image-controller add-image-targetallocator add-image-opampbridge container container-target-allocator container-operator-opamp-bridge start-kind cert-manager install-metrics-server install-targetallocator-prometheus-crds load-image-all deploy
308250

309251
.PHONY: prepare-e2e-with-featuregates
310-
prepare-e2e-with-featuregates: kuttl enable-operator-featuregates prepare-e2e
252+
prepare-e2e-with-featuregates: enable-operator-featuregates prepare-e2e
311253

312254
.PHONY: scorecard-tests
313255
scorecard-tests: operator-sdk
@@ -413,7 +355,6 @@ cmctl:
413355

414356
KUSTOMIZE ?= $(LOCALBIN)/kustomize
415357
KIND ?= $(LOCALBIN)/kind
416-
KUTTL ?= $(LOCALBIN)/kubectl-kuttl
417358
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
418359
ENVTEST ?= $(LOCALBIN)/setup-envtest
419360
CHLOGGEN ?= $(LOCALBIN)/chloggen
@@ -423,10 +364,9 @@ KUSTOMIZE_VERSION ?= v5.0.3
423364
CONTROLLER_TOOLS_VERSION ?= v0.12.0
424365
GOLANGCI_LINT_VERSION ?= v1.54.0
425366
KIND_VERSION ?= v0.20.0
426-
KUTTL_VERSION ?= 0.15.0
427367

428368
.PHONY: install-tools
429-
install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kuttl kind operator-sdk
369+
install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kind operator-sdk
430370

431371
.PHONY: kustomize
432372
kustomize: ## Download kustomize locally if necessary.
@@ -470,10 +410,6 @@ rm -rf $$TMP_DIR ;\
470410
}
471411
endef
472412

473-
.PHONY: kuttl
474-
kuttl: $(LOCALBIN)
475-
@KUTTL=$(KUTTL) KUTTL_VERSION=$(KUTTL_VERSION) ./hack/install-kuttl.sh
476-
477413
OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
478414
.PHONY: operator-sdk
479415
operator-sdk: $(LOCALBIN)

hack/install-kuttl.sh

-12
This file was deleted.

kuttl-test-autoscale.yaml

-6
This file was deleted.

kuttl-test-instrumentation.yaml

-5
This file was deleted.

kuttl-test-multi-instr.yaml

-6
This file was deleted.

kuttl-test-opampbridge.yaml

-6
This file was deleted.

kuttl-test-openshift.yaml

-6
This file was deleted.

kuttl-test-pdb.yaml

-6
This file was deleted.

kuttl-test-prometheuscr.yaml

-16
This file was deleted.

kuttl-test-targetallocator.yaml

-6
This file was deleted.

kuttl-test-upgrade.yaml

-19
This file was deleted.

0 commit comments

Comments
 (0)