Skip to content

Commit 8179168

Browse files
e2e local test for mac (#785)
Signed-off-by: akihikokuroda <[email protected]>
1 parent 24e05d1 commit 8179168

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ GO := GOFLAGS="-mod=vendor" go
33
CMDS := $(addprefix bin/, $(shell ls ./cmd | grep -v opm))
44
OPM := $(addprefix bin/, opm)
55
SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),)
6+
extra_env := $(GOENV)
67
export PKG := github.com/operator-framework/operator-registry
78
export GIT_COMMIT := $(or $(SOURCE_GIT_COMMIT),$(shell git rev-parse --short HEAD))
89
export OPM_VERSION := $(or $(SOURCE_GIT_TAG),$(shell git describe --always --tags HEAD))
@@ -35,12 +36,12 @@ endif
3536
all: clean test build
3637

3738
$(CMDS):
38-
$(GO) build $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@)
39+
$(extra_env) $(GO) build $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@)
3940

4041
.PHONY: $(OPM)
4142
$(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)'"
4243
$(OPM):
43-
$(GO) build $(opm_version_flags) $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@)
44+
$(extra_env) $(GO) build $(opm_version_flags) $(extra_flags) $(TAGS) -o $@ ./cmd/$(notdir $@)
4445

4546
.PHONY: build
4647
build: clean $(CMDS) $(OPM)

docs/contributors/e2e_tests.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ running even after the test suite has completed.
1919
1. Start the e2e tests:
2020

2121
```bash
22-
DOCKER_REGISTRY_HOST=localhost:5000 make build e2e SKIPTLS="true" CLUSTER=kind
22+
DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e SKIPTLS="true" CLUSTER=kind
2323
```
2424

2525
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions.
2626

2727
```bash
28-
DOCKER_REGISTRY_HOST=localhost:5000 make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="true" CLUSTER=kind
28+
DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="true" CLUSTER=kind
2929
```
3030

3131
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
4646
1. Start the e2e tests:
4747

4848
```bash
49-
DOCKER_REGISTRY_HOST=localhost:443 make build e2e CLUSTER=kind
49+
DOCKER_REGISTRY_HOST=localhost:443 GOENV='GOOS=linux' make build e2e CLUSTER=kind
5050
```
5151

5252
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions.
5353

5454
```bash
55-
DOCKER_REGISTRY_HOST=localhost:443 make build e2e TEST='builds and manipulates bundle and index images' CLUSTER=kind
55+
DOCKER_REGISTRY_HOST=localhost:443 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' CLUSTER=kind
5656
```
5757

5858
1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the

0 commit comments

Comments
 (0)