Skip to content

Commit

Permalink
Merge pull request #233 from ibihim/makefile-test-local
Browse files Browse the repository at this point in the history
Makefile: make local testing work with one command
  • Loading branch information
ibihim committed Apr 6, 2023
2 parents ad6505e + 9f436d4 commit 65c0919
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,18 @@ test-unit:
test-e2e:
go test -timeout 55m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG)

test-local:
@echo 'run: VERSION=local make clean container kind-create-cluster test'
test-local-setup: clean $(OUT_DIR)/$(BIN)-$(GOOS)-$(GOARCH) Dockerfile
docker build --build-arg BINARY=$(BIN)-$(GOOS)-$(GOARCH) --build-arg GOARCH=$(GOARCH) -t $(CONTAINER_NAME)-$(GOARCH) .
docker tag $(DOCKER_REPO):$(VERSION)-$(GOARCH) $(DOCKER_REPO):local

test-local: test-local-setup kind-create-cluster test

kind-delete-cluster:
kind delete cluster

kind-create-cluster: kind-delete-cluster
kind create cluster --config ./test/e2e/kind-config/kind-config.yaml
kind load docker-image $(CONTAINER_NAME)
kind load docker-image $(DOCKER_REPO):local

generate: build $(EMBEDMD_BINARY)
@echo ">> generating examples"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ Additionally, to my knowledge Envoy neither has nor plans Kubernetes specific RB

## Testing

To run tests locally, you need to have [kind](https://kind.sigs.k8s.io/) installed. By default it uses the default cluster, so be aware that it might override your default cluster.
To run tests locally, you need to have [kind](https://kind.sigs.k8s.io/) installed.
By default it uses the default cluster, so be aware that **it overrides your default kind cluster**.

The command to execute the tests is: `VERSION=local make clean container kind-create-cluster test`.
The command to execute the tests is: `make test-local`.

## Roadmap

Expand Down

0 comments on commit 65c0919

Please sign in to comment.