@@ -180,9 +180,10 @@ test: ## Run all tests with ginkgo, or only run the test package at {TEST_PKG} i
180180# will still have e2e tests run by Github Actions once they publish a pull
181181# request.
182182.PHONY : e2e-test
183+ e2e-test : go-test
184+ e2e-test : TEST_TAG = e2e
185+ e2e-test : GO_TEST_ARGS = $(E2E_GO_TEST_ARGS )
183186e2e-test : dummy-idp-docker dummy-auth0-docker kind-load-dummy-idp kind-load-dummy-auth0
184- e2e-test : # # Run only e2e tests, and only run the test package at {TEST_PKG} if it is specified
185- @$(MAKE ) --no-print-directory go-test TEST_TAG=e2e TEST_PKG=$(TEST_PKG )
186187
187188
188189# https://go.dev/blog/cover#heat-maps
@@ -217,10 +218,13 @@ ifeq ($(GOARCH), arm64)
217218endif
218219endif
219220
221+ # Skip -race on e2e. This requires building the codebase twice, and provides no value as the only code executed is test code.
222+ # Skip -vet; we already run it on the linter step and its very slow.
223+ E2E_GO_TEST_ARGS ?= -vet=off -timeout=25m -outputdir=$(OUTPUT_DIR )
220224# Testing flags: https://pkg.go.dev/cmd/go#hdr-Testing_flags
221225# The default timeout for a suite is 10 minutes, but this can be overridden by setting the -timeout flag. Currently set
222226# to 25 minutes based on the time it takes to run the longest test setup (kgateway_test).
223- GO_TEST_ARGS ?= -timeout=25m -cpu=4 -race -outputdir= $( OUTPUT_DIR )
227+ GO_TEST_ARGS ?= $( E2E_GO_TEST_ARGS ) -race
224228GO_TEST_COVERAGE_ARGS ?= --cover --covermode=atomic --coverprofile=cover.out
225229GO_TEST_COVERAGE ?= go tool github.com/vladopajic/go-test-coverage/v2
226230
@@ -429,15 +433,26 @@ kgateway: $(CONTROLLER_OUTPUT_DIR)/kgateway-linux-$(GOARCH)
429433$(CONTROLLER_OUTPUT_DIR ) /Dockerfile : cmd/kgateway/Dockerfile
430434 cp $< $@
431435
436+ $(CONTROLLER_OUTPUT_DIR ) /Dockerfile.agentgateway : cmd/kgateway/Dockerfile.agentgateway
437+ cp $< $@
438+
432439$(CONTROLLER_OUTPUT_DIR ) /.docker-stamp-$(VERSION ) -$(GOARCH ) : $(CONTROLLER_OUTPUT_DIR ) /kgateway-linux-$(GOARCH ) $(CONTROLLER_OUTPUT_DIR ) /Dockerfile
433440 $(BUILDX_BUILD ) --load $(PLATFORM ) $(CONTROLLER_OUTPUT_DIR ) -f $(CONTROLLER_OUTPUT_DIR ) /Dockerfile \
434441 --build-arg GOARCH=$(GOARCH ) \
435442 --build-arg ENVOY_IMAGE=$(ENVOY_IMAGE ) \
436443 -t $(IMAGE_REGISTRY ) /$(CONTROLLER_IMAGE_REPO ) :$(VERSION )
437444 @touch $@
438445
446+ $(CONTROLLER_OUTPUT_DIR ) /.docker-stamp-agentgateway-$(VERSION ) -$(GOARCH ) : $(CONTROLLER_OUTPUT_DIR ) /kgateway-linux-$(GOARCH ) $(CONTROLLER_OUTPUT_DIR ) /Dockerfile.agentgateway
447+ $(BUILDX_BUILD ) --load $(PLATFORM ) $(CONTROLLER_OUTPUT_DIR ) -f $(CONTROLLER_OUTPUT_DIR ) /Dockerfile.agentgateway \
448+ --build-arg GOARCH=$(GOARCH ) \
449+ -t $(IMAGE_REGISTRY ) /$(CONTROLLER_IMAGE_REPO ) :$(VERSION )
450+ @touch $@
451+
439452.PHONY : kgateway-docker
440453kgateway-docker : $(CONTROLLER_OUTPUT_DIR ) /.docker-stamp-$(VERSION ) -$(GOARCH )
454+ .PHONY : kgateway-agentgateway-docker
455+ kgateway-agentgateway-docker : $(CONTROLLER_OUTPUT_DIR ) /.docker-stamp-agentgateway-$(VERSION ) -$(GOARCH )
441456
442457# ----------------------------------------------------------------------------------
443458# SDS Server - gRPC server for serving Secret Discovery Service config
@@ -716,6 +731,7 @@ kind-load-%:
716731# Depends on: IMAGE_REGISTRY, VERSION, CLUSTER_NAME
717732# Envoy image may be specified via ENVOY_IMAGE on the command line or at the top of this file
718733kind-build-and-load-% : % -docker kind-load-% ; # # Use to build specified image and load it into kind
734+ kind-build-and-load-kgateway-agentgateway : kgateway-agentgateway-docker kind-load-kgateway ; # # Use to build specified image and load it into kind
719735
720736# Update the docker image used by a deployment
721737# This works for most of our deployments because the deployment name and container name both match
0 commit comments