From cc2659eee0c6a333a2ff3949b1c63a558c5fb02f Mon Sep 17 00:00:00 2001 From: akihikokuroda Date: Thu, 30 Sep 2021 16:56:25 +0000 Subject: [PATCH] e2e local test for mac Signed-off-by: akihikokuroda --- Makefile | 5 +++-- docs/contributors/e2e_tests.md | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7b2d6f0a6..b7498c34b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ GO := GOFLAGS="-mod=vendor" go CMDS := $(addprefix bin/, $(shell ls ./cmd | grep -v opm)) OPM := $(addprefix bin/, opm) SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),) +extra_env := $(GOENV) export PKG := github.com/operator-framework/operator-registry export GIT_COMMIT := $(or $(SOURCE_GIT_COMMIT),$(shell git rev-parse --short HEAD)) export OPM_VERSION := $(or $(SOURCE_GIT_TAG),$(shell git describe --always --tags HEAD)) @@ -34,11 +35,11 @@ endif all: clean test build $(CMDS): - $(GO) build $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@) + $(extra_env) $(GO) build $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@) $(OPM): opm_version_flags=-ldflags "-X '$(PKG)/cmd/opm/version.gitCommit=$(GIT_COMMIT)' -X '$(PKG)/cmd/opm/version.opmVersion=$(OPM_VERSION)' -X '$(PKG)/cmd/opm/version.buildDate=$(BUILD_DATE)'" $(OPM): - $(GO) build $(opm_version_flags) $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@) + $(extra_env) $(GO) build $(opm_version_flags) $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@) .PHONY: build build: clean $(CMDS) $(OPM) diff --git a/docs/contributors/e2e_tests.md b/docs/contributors/e2e_tests.md index 5b683a768..a0eb50eed 100644 --- a/docs/contributors/e2e_tests.md +++ b/docs/contributors/e2e_tests.md @@ -19,13 +19,13 @@ running even after the test suite has completed. 1. Start the e2e tests: ```bash - DOCKER_REGISTRY_HOST=localhost:5000 make build e2e SKIPTLS="true" CLUSTER=kind + DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e SKIPTLS="true" CLUSTER=kind ``` 1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions. ```bash - DOCKER_REGISTRY_HOST=localhost:5000 make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="true" CLUSTER=kind + DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="true" CLUSTER=kind ``` 1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the @@ -46,13 +46,13 @@ make file and use `-dryRun` with `-focus` and see if the regex would trigger you 1. Start the e2e tests: ```bash - DOCKER_REGISTRY_HOST=localhost:443 make build e2e CLUSTER=kind + DOCKER_REGISTRY_HOST=localhost:443 GOENV='GOOS=linux' make build e2e CLUSTER=kind ``` 1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions. ```bash - DOCKER_REGISTRY_HOST=localhost:443 make build e2e TEST='builds and manipulates bundle and index images' CLUSTER=kind + DOCKER_REGISTRY_HOST=localhost:443 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' CLUSTER=kind ``` 1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the