Skip to content

Commit f4952ed

Browse files
🛠️ Convert helper ginkgo tests to regular unit tests (#649)
* TFECO-10811 Replace ginkgo tests with testify/assert unit tests * Add new make target for unit tests * Update dependency
1 parent 6f7c41f commit f4952ed

File tree

4 files changed

+299
-200
lines changed

4 files changed

+299
-200
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ jobs:
2929
run: |
3030
make test-api
3131
make test-internal
32+
make test-unit

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ test-internal: fmt vet copywrite ## Run internal/* tests.
148148
./internal/pointer \
149149
./internal/slice
150150

151+
.PHONY: test-unit
152+
test-unit: fmt vet copywrite ## Run internal/controller tests.
153+
go test ./internal/controller/... \
154+
-timeout 5m \
155+
-count 1 \
156+
-v \
157+
-run="^Test(DoNotRequeue|RequeueAfter|RequeueOnErr|FormatOutput|FinalizerBehaviors|MatchWildcardName|ValidateTFEVersion)$$"
158+
151159
.PHONY: test-helm
152160
test-helm: ## Run Helm chart tests.
153161
cd charts/test; go test -timeout 5m -count=1 -v ./...

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ require (
1111
github.com/onsi/ginkgo/v2 v2.23.4
1212
github.com/onsi/gomega v1.36.3
1313
github.com/prometheus/client_golang v1.22.0
14+
github.com/stretchr/testify v1.11.1
1415
go.uber.org/zap v1.27.0
1516
k8s.io/api v0.34.1
1617
k8s.io/apimachinery v0.34.1

0 commit comments

Comments
 (0)