Skip to content

Refactor e2e test execution scripts#12452

Open
caseydavenport wants to merge 5 commits intoprojectcalico:masterfrom
caseydavenport:casey-local-e2e-only
Open

Refactor e2e test execution scripts#12452
caseydavenport wants to merge 5 commits intoprojectcalico:masterfrom
caseydavenport:casey-local-e2e-only

Conversation

@caseydavenport
Copy link
Copy Markdown
Member

@caseydavenport caseydavenport commented Apr 13, 2026

This PR refactors body_standard.sh into smaller composable phase scripts, and reworks how e2e binaries are sourced:

  • Per-PR CI (RUN_LOCAL_TESTS): builds the e2e binary from source
  • Scheduled CI (TEST_TYPE=k8s-e2e): downloads the e2e binary from the latest hashrelease
  • Other test types (benchmarks, cert, etc.): falls back to bz tests

Also adds an e2e-run Makefile target and switches GCP e2e tests to use a config file instead of inline flags.

Supersedes #12507.

None

@caseydavenport caseydavenport requested review from a team as code owners April 13, 2026 21:31
Copilot AI review requested due to automatic review settings April 13, 2026 21:31
@marvin-tigera marvin-tigera added this to the Calico v3.33.0 milestone Apr 13, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 13, 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

This PR updates Calico’s Semaphore end-to-end (e2e) CI execution to consistently run the in-repo e2e test binaries, and refactors the main “standard” job script into smaller phase scripts for readability and reuse.

Changes:

  • Switches the GCP e2e job configuration from K8S_E2E_FLAGS/RUN_LOCAL_TESTS to config-driven selection via E2E_TEST_CONFIG.
  • Refactors .semaphore/end-to-end/scripts/body_standard.sh into composable phase scripts under scripts/phases/.
  • Adds Makefile targets (e2e-run, e2e-run-cnp) to run e2e tests against an explicit KUBECONFIG, with configurable output/report paths.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
e2e/config/gcp-bpf.yaml Makes GCP BPF test selection fully config-driven (no extends).
Makefile Adds e2e-run/e2e-run-cnp targets and parameterizes report output.
.semaphore/semaphore.yml.d/blocks/20-e2e-gcp.yml Updates the GCP e2e block to provide E2E_TEST_CONFIG instead of label-filter flags.
.semaphore/semaphore.yml Regenerates the compiled Semaphore pipeline to match the block changes.
.semaphore/semaphore-scheduled-builds.yml Applies the same env var changes for scheduled runs.
.semaphore/end-to-end/scripts/phases/*.sh Introduces phase scripts for provision/install/configure/migrate/test/hcp flows.
.semaphore/end-to-end/scripts/body_standard.sh Converts the monolithic standard e2e flow into phase dispatch.
.semaphore/end-to-end/scripts/body_flannel-migration.sh Reuses the new provisioning phase and improves inline documentation/formatting.
.semaphore/end-to-end/scripts/README.md Documents the phase model and how to run phases locally.

Comment thread .semaphore/end-to-end/scripts/phases/run_tests_local.sh Outdated
Comment thread .semaphore/end-to-end/scripts/phases/run_tests_local.sh Outdated
Comment thread Makefile
Comment thread .semaphore/end-to-end/scripts/phases/migrate.sh Outdated
Comment thread .semaphore/end-to-end/scripts/phases/configure.sh
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Apr 13, 2026
@marvin-tigera marvin-tigera removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 13, 2026
Comment thread .semaphore/end-to-end/scripts/phases/configure.sh
Comment thread .semaphore/end-to-end/scripts/phases/run_tests_local.sh Outdated
Comment thread .semaphore/end-to-end/scripts/body_standard.sh
Comment thread .semaphore/end-to-end/scripts/body_standard.sh
Comment thread .semaphore/semaphore.yml.d/blocks/20-e2e-gcp.yml
Comment thread .semaphore/end-to-end/scripts/body_standard.sh
Fail fast with a clear error message when required environment variables
are missing, rather than letting scripts blow up with cryptic errors
downstream. Also fix migrate.sh to capture stderr in the bz upgrade
log (|& instead of |) for consistency with the other phases.
Add || exit to pushd/popd in run_tests_local.sh (SC2164), and
replace single-item for loop with a direct check in configure.sh
(SC2043).
@caseydavenport caseydavenport changed the title Update e2e pipelines to use local builds unconditionally Refactor e2e test execution scripts 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

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants