Skip to content

Use hashrelease e2e binary in CI pipeline#12507

Closed
caseydavenport wants to merge 2 commits intoprojectcalico:masterfrom
caseydavenport:casey-e2e-use-artifact
Closed

Use hashrelease e2e binary in CI pipeline#12507
caseydavenport wants to merge 2 commits intoprojectcalico:masterfrom
caseydavenport:casey-e2e-use-artifact

Conversation

@caseydavenport
Copy link
Copy Markdown
Member

Stacked on #12506 - merge that first.

Updates the CI pipeline script to download the pre-built e2e binary from the hashrelease instead of calling bz tests. The RUN_LOCAL_TESTS path (used by the GCP e2e block) still builds from source. Both paths now share a unified execution step using the ginkgo CLI in a calico/go-build Docker container.

This replaces the opaque bz tests call with direct binary execution, which makes test selection visible in the pipeline config (via K8S_E2E_FLAGS) and ensures the test binary matches the installed Calico version.

Part 2 of splitting #12351.

None

@caseydavenport caseydavenport requested review from a team as code owners April 16, 2026 15:09
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 15:09
@marvin-tigera marvin-tigera added this to the Calico v3.33.0 milestone Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Calico’s CI e2e execution flow to run an explicit e2e test binary (preferably downloaded from hashrelease artifacts) and execute it via the Ginkgo CLI in a calico/go-build container, instead of using the opaque bz tests entrypoint.

Changes:

  • Add a release build step to produce and publish multi-arch e2e test binaries into the hashrelease output (files/e2e/).
  • Extend e2e/Makefile with multi-arch build targets and a build-all aggregator.
  • Update Semaphore e2e job script to either build the binary locally or download it from hashrelease, then run it via ginkgo.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
release/pkg/manager/calico/manager.go Adds e2e binary build+copy into release/hashrelease output during Build().
e2e/Makefile Introduces multi-arch e2e binary targets and a build-all entrypoint.
.semaphore/end-to-end/scripts/body_standard.sh Switches CI to download/run the hashrelease e2e binary (or build locally) and runs via ginkgo in Docker.

Comment thread e2e/Makefile
Comment on lines +22 to +37
# Multi-arch e2e binary targets. Each architecture gets its own binary, built
# via cross-compilation inside the calico/go-build container.
bin/k8s/e2e-linux-amd64.test: $(SRC_FILES)
mkdir -p bin/k8s
$(MAKE) build-e2e-binary ARCH=amd64

bin/k8s/e2e-linux-arm64.test: $(SRC_FILES)
mkdir -p bin/k8s
$(MAKE) build-e2e-binary ARCH=arm64

.PHONY: build-e2e-binary
build-e2e-binary:
$(DOCKER_RUN) $(CALICO_BUILD) go test ./cmd/k8s -c -o bin/k8s/e2e-linux-$(ARCH).test

.PHONY: build-all
build-all: $(addprefix bin/k8s/e2e-linux-,$(addsuffix .test,$(VALIDARCHES)))
dst := filepath.Join(e2eOutputDir, entry.Name())
if err := utils.CopyFile(src, dst); err != nil {
return fmt.Errorf("copying e2e binary %s: %w", entry.Name(), err)
}
Comment thread release/pkg/manager/calico/manager.go Outdated
Comment on lines +313 to +317
}

// Build multi-arch e2e test binaries and copy them into the output directory.
if err = r.buildE2EBinaries(); err != nil {
return err
Comment thread .semaphore/end-to-end/scripts/body_standard.sh Outdated
Comment thread .semaphore/end-to-end/scripts/body_standard.sh
@caseydavenport caseydavenport force-pushed the casey-e2e-use-artifact branch from feb18b4 to be5f37f Compare April 16, 2026 15:39
Download the pre-built e2e test binary from the hashrelease instead of
calling bz tests. The RUN_LOCAL_TESTS path still builds from source.
Both paths share a unified docker run execution step.
@caseydavenport caseydavenport force-pushed the casey-e2e-use-artifact branch from be5f37f to f1ab502 Compare April 17, 2026 16:15
Add --junit-report and --output-dir flags back to the ginkgo invocation
so the epilogue can publish test results. Use the e2e_rc pattern to
capture the test exit code and propagate it after copying the JUnit XML.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@caseydavenport caseydavenport force-pushed the casey-e2e-use-artifact branch from 3f5f2a3 to 399e009 Compare April 17, 2026 16:23
caseydavenport added a commit to caseydavenport/calico that referenced this pull request Apr 17, 2026
Replace run_tests_local.sh with run_tests.sh that supports three modes:
1. RUN_LOCAL_TESTS set: build from local source (per-PR CI)
2. TEST_TYPE == k8s-e2e: download pre-built binary from hashrelease
   (scheduled CI)
3. Otherwise: fall back to bz tests (benchmarks, certification, etc.)

This consolidates the work from projectcalico#12507 into the phase-script structure,
and addresses lwr20's review feedback about bz tests handling non-e2e
test types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@caseydavenport
Copy link
Copy Markdown
Member Author

Incorporated into #12452

@caseydavenport caseydavenport deleted the casey-e2e-use-artifact branch April 17, 2026 16:40
@marvin-tigera marvin-tigera removed docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Apr 17, 2026
caseydavenport added a commit to caseydavenport/calico that referenced this pull request Apr 17, 2026
Replace run_tests_local.sh with run_tests.sh that supports three modes:
1. RUN_LOCAL_TESTS set: build from local source (per-PR CI)
2. TEST_TYPE == k8s-e2e: download pre-built binary from hashrelease
   (scheduled CI)
3. Otherwise: fall back to bz tests (benchmarks, certification, etc.)

This consolidates the work from projectcalico#12507 into the phase-script structure,
and addresses lwr20's review feedback about bz tests handling non-e2e
test types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
caseydavenport added a commit to caseydavenport/calico that referenced this pull request Apr 17, 2026
Replace run_tests_local.sh with run_tests.sh that supports three modes:
1. RUN_LOCAL_TESTS set: build from local source (per-PR CI)
2. TEST_TYPE == k8s-e2e: download pre-built binary from hashrelease
   (scheduled CI)
3. Otherwise: fall back to bz tests (benchmarks, certification, etc.)

This consolidates the work from projectcalico#12507 into the phase-script structure,
and addresses lwr20's review feedback about bz tests handling non-e2e
test types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants