NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern#1068
Conversation
WalkthroughThe PR gates E2E sources behind the ChangesE2E test flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ebfb6c7 to
dd97929
Compare
Add //go:build e2e to all e2e test files and the framework so that go test ./... works locally without a cluster. CI runs e2e via make test-e2e which passes -tags e2e. Replace the ErrSkip sentinel with direct error returns from framework.New() — the build tag is the exclusion mechanism, not runtime skips. Tests now t.Fatal immediately if KUBECONFIG or PLUGIN_URL are unset when compiled with the e2e tag. Also adds a unit-test Makefile alias (delegates to test-backend) for clarity. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@sradco: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/retitle NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern |
|
@sradco: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PeterYurkovich, simonpasquier, sradco The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d8451a1
into
openshift:main-alerts-management-api
Summary
//go:build e2econstraint to all e2e test files and the framework sogo test ./...works locally without a clusterErrSkipsentinel pattern —framework.New()returns a direct error ifKUBECONFIGorPLUGIN_URLare unset; testst.Fatalimmediatelymake test-e2ewhich passes-tags e2eunit-testMakefile alias (delegates totest-backend) for clarityTest plan
go test ./pkg/... ./internal/...passes locally (e2e files excluded)go build ./...succeeds (e2e files excluded without tag)go-testsjob passes (usesmake test-backend)e2e-management-apijob passes (usesmake test-e2ewith-tags e2e)Signed-off-by: Shirly Radco sradco@redhat.com
Made with Cursor
Summary by CodeRabbit