From 87b3e321c8637a69e4fe4411054a903224989881 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 27 Jun 2023 12:46:31 +0100 Subject: [PATCH 1/3] Disable CGO when compiling an e2e.test binary Signed-off-by: Richard Wall --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index bc79cc273..a67312ef3 100644 --- a/make/test.mk +++ b/make/test.mk @@ -128,7 +128,7 @@ e2e-ci: | $(NEEDS_GO) make/e2e-ci.sh $(BINDIR)/test/e2e.test: FORCE | $(NEEDS_GINKGO) $(BINDIR)/test - $(GINKGO) build --tags e2e_test test/e2e + CGO_ENABLED=0 $(GINKGO) build --tags e2e_test test/e2e mv test/e2e/e2e.test $(BINDIR)/test/e2e.test .PHONY: e2e-build From cc0782b917bfdbf75303eb8278244914069dedd0 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 27 Jun 2023 12:47:08 +0100 Subject: [PATCH 2/3] Reduce binary size by stripping dwarf tables and symbol tables Signed-off-by: Richard Wall --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index a67312ef3..c4fc3a07f 100644 --- a/make/test.mk +++ b/make/test.mk @@ -128,7 +128,7 @@ e2e-ci: | $(NEEDS_GO) make/e2e-ci.sh $(BINDIR)/test/e2e.test: FORCE | $(NEEDS_GINKGO) $(BINDIR)/test - CGO_ENABLED=0 $(GINKGO) build --tags e2e_test test/e2e + CGO_ENABLED=0 $(GINKGO) build --ldflags="-w -s" --trimpath --tags e2e_test test/e2e mv test/e2e/e2e.test $(BINDIR)/test/e2e.test .PHONY: e2e-build From 7ee4c0b1e1e3d2ec3795f79027955acd31bbf05e Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 27 Jun 2023 12:49:13 +0100 Subject: [PATCH 3/3] Use the correct path in the the example command Signed-off-by: Richard Wall --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index c4fc3a07f..1b52a33fb 100644 --- a/make/test.mk +++ b/make/test.mk @@ -150,7 +150,7 @@ $(BINDIR)/test/e2e.test: FORCE | $(NEEDS_GINKGO) $(BINDIR)/test ## Here's an example of how you might run a subset of the end-to-end tests ## which only require cert-manager to be installed: ## -## ./e2e --repo-root=/dev/null --ginkgo.focus="CA\ Issuer" --ginkgo.skip="Gateway" +## ./_bin/test/e2e.test --repo-root=/dev/null --ginkgo.focus="CA\ Issuer" --ginkgo.skip="Gateway" ## ## @category Development e2e-build: $(BINDIR)/test/e2e.test