Skip to content

Commit 6224a06

Browse files
authored
Merge pull request #1933 from Adirio/cleanup-tests
🌱 Tests cleanup
2 parents 5044d6e + 8c08161 commit 6224a06

File tree

20 files changed

+411
-489
lines changed

20 files changed

+411
-489
lines changed

Makefile

+25-16
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ generate: generate-testdata ## Update/generate all mock data. You should run thi
6868

6969
.PHONY: generate-testdata
7070
generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/kubebuilder
71-
./generate_testdata.sh
71+
./test/testdata/generate.sh
7272

7373
.PHONY: lint
7474
lint: golangci-lint ## Run golangci-lint linter
@@ -87,26 +87,35 @@ golangci-lint:
8787

8888
##@ Tests
8989

90-
.PHONY: go-test
91-
go-test: ## Run the unit test
92-
go test -race -v ./cmd/... ./pkg/... ./plugins/...
93-
9490
.PHONY: test
95-
test: ## Run the unit tests (used in the CI)
96-
./test.sh
91+
test: test-unit test-integration test-testdata ## Run the unit and integration tests (used in the CI)
92+
93+
.PHONY: test-unit
94+
test-unit: ## Run the unit tests
95+
go test -race -v ./pkg/...
9796

9897
.PHONY: test-coverage
99-
test-coverage: ## Run coveralls
100-
# remove all coverage files if exists
101-
- rm -rf *.out
102-
# run the go tests and gen the file coverage-all used to do the integration with coverrals.io
98+
test-coverage: ## Run unit tests creating the output to report coverage
99+
- rm -rf *.out # Remove all coverage files if exists
103100
go test -race -failfast -tags=integration -coverprofile=coverage-all.out ./cmd/... ./pkg/... ./plugins/...
104101

105-
.PHONY: test-e2e-local
106-
test-e2e-local: ## It will run the script to install kind and run e2e tests
107-
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`
108-
./test_e2e_local.sh
102+
.PHONY: test-integration
103+
test-integration: ## Run the integration tests
104+
./test/integration.sh
109105

110106
.PHONY: check-testdata
111107
check-testdata: ## Run the script to ensure that the testdata is updated
112-
./check_testdata.sh
108+
./test/testdata/check.sh
109+
110+
.PHONY: test-testdata
111+
test-testdata: ## Run the tests of the testdata directory
112+
./test/testdata/test.sh
113+
114+
.PHONY: test-e2e-local
115+
test-e2e-local: ## Run the end-to-end tests locally
116+
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`
117+
./test/e2e/local.sh
118+
119+
.PHONY: test-e2e-ci
120+
test-e2e-ci: ## Run the end-to-end tests (used in the CI)`
121+
./test/e2e/ci.sh

common.sh

-204
This file was deleted.

0 commit comments

Comments
 (0)