Skip to content

Commit b172b1e

Browse files
committed
wip: debug timings
Signed-off-by: John Howard <[email protected]>
1 parent c6fb1a8 commit b172b1e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/actions/kubernetes-e2e-tests/action.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ runs:
3030
CLUSTER_NAME: ${{ inputs.cluster-name }}
3131
ISTIO_VERSION: ${{ inputs.istio-version }}
3232
TEST_PKG: ./test/e2e/tests
33+
# Doesn't really matter, but using the same as `go build` means we can re-use the same Go cache.
34+
CGO_ENABLED: 0
3335
shell: bash
3436
run: make e2e-test
3537
- name: Archive bug report directory on failure
@@ -38,3 +40,8 @@ runs:
3840
with:
3941
name: bug-report-${{ inputs.cluster-name }}-${{ inputs.matrix-label }}
4042
path: ./_test/bug_report/${{ inputs.cluster-name }}
43+
- name: Upload build timings
44+
uses: ./.github/actions/upload-artifact
45+
with:
46+
name: bug-report-${{ inputs.cluster-name }}-${{ inputs.matrix-label }}
47+
path: ./_test/timings/${{ inputs.cluster-name }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ endif
220220
endif
221221

222222
# Skip -race on e2e. This requires building the codebase twice, and provides no value as the only code executed is test code.
223-
E2E_GO_TEST_ARGS ?= -timeout=25m -cpu=4 -outputdir=$(OUTPUT_DIR)
223+
E2E_GO_TEST_ARGS ?= -timeout=25m -cpu=4 -outputdir=$(OUTPUT_DIR) -debug-actiongraph=./_test/timings/$(CLUSTER_NAME)/actiongraph-test -debug-trace=./_test/timings/$(CLUSTER_NAME)/trace-test
224224
# Testing flags: https://pkg.go.dev/cmd/go#hdr-Testing_flags
225225
# The default timeout for a suite is 10 minutes, but this can be overridden by setting the -timeout flag. Currently set
226226
# to 25 minutes based on the time it takes to run the longest test setup (kgateway_test).
@@ -422,7 +422,7 @@ export CONTROLLER_IMAGE_REPO ?= kgateway
422422
# We include the files in K8S_GATEWAY_SOURCES as dependencies to the kgateway build
423423
# so changes in those directories cause the make target to rebuild
424424
$(CONTROLLER_OUTPUT_DIR)/kgateway-linux-$(GOARCH): $(K8S_GATEWAY_SOURCES)
425-
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ ./cmd/kgateway/...
425+
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ -debug-actiongraph=./_test/timings/$(CLUSTER_NAME)/actiongraph-build -debug-trace=./_test/timings/$(CLUSTER_NAME)/trace-build ./cmd/kgateway/...
426426

427427
.PHONY: kgateway
428428
kgateway: $(CONTROLLER_OUTPUT_DIR)/kgateway-linux-$(GOARCH)

hack/kind/setup-kind.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ LOCALSTACK="${LOCALSTACK:-false}"
3333
# Export the variables so they are available in the environment
3434
export VERSION CLUSTER_NAME
3535

36+
mkdir -p ./_test/timings/$CLUSTER_NAME
37+
3638
function create_kind_cluster_or_skip() {
3739
activeClusters=$(kind get clusters)
3840

0 commit comments

Comments
 (0)