You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Ensure you activate module support before continue (`$ export GO111MODULE=on`)
38
-
1. Run the command `make install` to create a bin with the source code
38
+
1. Run the command `make install` to create a bin with the source code
39
39
40
40
**NOTE** In order to check the local environment run `make test-unit`.
41
41
42
-
## What to do before submitting a pull request
42
+
## What to do before submitting a pull request
43
43
44
-
1. Run the script `make generate` to update/generate the mock data used in the e2e test in `$GOPATH/src/sigs.k8s.io/kubebuilder/testdata/`
44
+
1. Run the script `make generate` to update/generate the mock data used in the e2e test in `$GOPATH/src/sigs.k8s.io/kubebuilder/testdata/`
45
+
1. Run `make test-unit test-e2e-local`
46
+
- e2e tests use [`kind`][kind] and [`setup-envtest`][setup-envtest]. If you want to bring your own binaries, place them in `$(go env GOPATH)/bin`.
45
47
46
48
**IMPORTANT:** The `make generate` is very helpful. By using it, you can check if good part of the commands still working successfully after the changes. Also, note that its usage is a pre-requirement to submit a PR.
47
49
@@ -87,9 +89,9 @@ separately.
87
89
88
90
## Where the CI Tests are configured
89
91
90
-
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
91
-
1. Note that the prow tests used in the CI are configured in [kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml).
92
-
1. Check that all scripts used by the CI are defined in the project.
92
+
1. See the [action files](.github/workflows) to check its tests, and the scripts used on it.
93
+
1. Note that the prow tests used in the CI are configured in [kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/kubebuilder/kubebuilder-presubmits.yaml).
94
+
1. Check that all scripts used by the CI are defined in the project.
93
95
94
96
## How to contribute to docs
95
97
@@ -102,7 +104,7 @@ The docs are published off of three branches:
cd tools && go build -tags=tools -o $(GO_APIDIFF) github.com/joelanford/go-apidiff ;\
86
96
}
87
97
88
98
##@ Tests
@@ -91,13 +101,14 @@ golangci-lint:
91
101
test: test-unit test-integration test-testdata test-book ## Run the unit and integration tests (used in the CI)
92
102
93
103
.PHONY: test-unit
104
+
TEST_PKGS := ./pkg/... ./test/e2e/utils/...
94
105
test-unit: ## Run the unit tests
95
-
go test -race -v ./pkg/...
106
+
go test -race $(TEST_PKGS)
96
107
97
108
.PHONY: test-coverage
98
109
test-coverage: ## Run unit tests creating the output to report coverage
99
110
- rm -rf *.out # Remove all coverage files if exists
100
-
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/machinery/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang"./pkg/...
111
+
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/machinery/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang"$(TEST_PKGS)
0 commit comments