Skip to content

Commit

Permalink
Use go list -mod=mod
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
  • Loading branch information
kaovilai committed Feb 16, 2024
1 parent 2e0665a commit 7eb4820
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,15 @@ $(ENVTEST): ## Download envtest-setup locally if necessary.
.PHONY: envtest
envtest: $(ENVTEST)

# If test results in prow are different, it is because the environment used.
# You can simulate their env by running
# docker run --platform linux/amd64 -w $PWD -v $PWD:$PWD -it registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 sh -c "make test"
# where the image corresponds to the prow config for the test job, https://github.com/openshift/release/blob/master/ci-operator/config/openshift/oadp-operator/openshift-oadp-operator-master.yaml#L1-L5
# to login to registry cluster follow https://docs.ci.openshift.org/docs/how-tos/use-registries-in-build-farm/#how-do-i-log-in-to-pull-images-that-require-authentication
# If bin/ contains binaries of different arch, you may remove them so the container can install their arch.
.PHONY: test
test: vet envtest ## Run Go linter and unit tests and check Go code format and if api and bundle folders are up to date.
KUBEBUILDER_ASSETS="$(ENVTESTPATH)" go test -mod=mod $(shell go list ./... | grep -v /tests/e2e) -coverprofile cover.out
KUBEBUILDER_ASSETS="$(ENVTESTPATH)" go test -mod=mod $(shell go list -mod=mod ./... | grep -v /tests/e2e) -coverprofile cover.out
@make fmt-isupdated
@make api-isupdated
@make bundle-isupdated
Expand Down

0 comments on commit 7eb4820

Please sign in to comment.