Skip to content

✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests #4946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Jul 20, 2025

Motivation

Some users unintentionally ran E2E tests against production environments by using go test ./.... This can lead to dangerous side effects like uninstalling Cert Manager or modifying shared clusters.

What’s Changed

  • Added //go:build e2e tags to all E2E test files.
  • Updated the Makefile to run E2E tests with -tags=e2e.

How to Run E2E Tests Now

You must explicitly pass the tag:

make test-e2e
# or
go test -tags=e2e ./test/e2e/...

Result

E2E tests are no longer included in default go test ./... runs, reducing risk of accidental execution.

Closes: #4116

c/c @applejag

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 20, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 20, 2025
@camilamacedo86 camilamacedo86 force-pushed the e2e-test-add-tags branch 2 times, most recently from d0157a0 to d90cbbd Compare July 20, 2025 10:11
@camilamacedo86 camilamacedo86 changed the title ✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests ✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests Jul 20, 2025
@camilamacedo86 camilamacedo86 changed the title ✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests WIP (small fixes)✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests Jul 20, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: applejag, camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@camilamacedo86 camilamacedo86 force-pushed the e2e-test-add-tags branch 3 times, most recently from 88d1b12 to 535aa82 Compare July 20, 2025 10:53
@camilamacedo86 camilamacedo86 changed the title WIP (small fixes)✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests ✨ (go/v4) add e2e build tag to prevent accidental execution of end-to-end tests Jul 20, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 20, 2025
@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2109798 into kubernetes-sigs:master Jul 22, 2025
33 checks passed
@camilamacedo86 camilamacedo86 deleted the e2e-test-add-tags branch July 22, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e tests should be opt-in
3 participants