Skip to content

Commit f486436

Browse files
author
Per Goncalves da Silva
committed
Add test-operator unit tests to CI
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent af79bbb commit f486436

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/testdata.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: testdata
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
merge_group:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
unit-test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version-file: go.mod
20+
21+
- name: Run test-operator unit tests
22+
run: |
23+
make test-test-operator

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ test-unit: $(SETUP_ENVTEST) envtest-k8s-bins #HELP Run the unit tests
246246
$(UNIT_TEST_DIRS) \
247247
-test.gocoverdir=$(COVERAGE_UNIT_DIR)
248248

249+
250+
.PHONY: test-test-operator
251+
test-test-operator: $(SETUP_ENVTEST) envtest-k8s-bins
252+
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use -p path $(ENVTEST_VERSION) $(SETUP_ENVTEST_BIN_DIR_OVERRIDE))" \
253+
CGO_ENABLED=1 go test -tags '$(GO_BUILD_TAGS)' -count=1 -race -short ./testdata/images/bundles/test-operator/...
254+
249255
TEST_OPERATOR_CONTROLLERS_HOME=./testdata/images/controllers
250256
TEST_OPERATOR_CONTROLLERS=v1.0.0 v2.0.0
251257

0 commit comments

Comments
 (0)