Skip to content

NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern#1068

Merged
PeterYurkovich merged 1 commit into
openshift:main-alerts-management-apifrom
sradco:e2e-build-tags
Jul 21, 2026
Merged

NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern#1068
PeterYurkovich merged 1 commit into
openshift:main-alerts-management-apifrom
sradco:e2e-build-tags

Conversation

@sradco

@sradco sradco commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • Adds //go:build e2e constraint to all e2e test files and the framework so go test ./... works locally without a cluster
  • Removes the ErrSkip sentinel pattern — framework.New() returns a direct error if KUBECONFIG or PLUGIN_URL are unset; tests t.Fatal immediately
  • CI runs e2e via make test-e2e which passes -tags e2e
  • Adds unit-test Makefile alias (delegates to test-backend) for clarity

Test plan

  • go test ./pkg/... ./internal/... passes locally (e2e files excluded)
  • go build ./... succeeds (e2e files excluded without tag)
  • CI go-tests job passes (uses make test-backend)
  • CI e2e-management-api job passes (uses make test-e2e with -tags e2e)

Signed-off-by: Shirly Radco sradco@redhat.com

Made with Cursor

Summary by CodeRabbit

  • Tests
    • Added a dedicated command for running backend unit tests.
    • End-to-end tests now run explicitly with the E2E test configuration.
    • E2E tests and supporting helpers are isolated from standard test runs.
    • Missing E2E configuration now produces clear test failures instead of silently skipping tests.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2026
@openshift-ci
openshift-ci Bot requested review from PeterYurkovich and zhuje July 20, 2026 14:16
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Walkthrough

The PR gates E2E sources behind the e2e build tag, changes missing E2E configuration into fatal setup errors, adds a unit-test Make target, and runs E2E tests with the tag enabled.

Changes

E2E test flow

Layer / File(s) Summary
E2E gating and framework setup
test/e2e/*, test/e2e/framework/framework.go
E2E files require the e2e build tag; framework setup errors no longer use ErrSkip, and affected tests fail on setup errors.
Makefile test orchestration
Makefile
Adds unit-test as an alias for test-backend and enables the e2e tag for test-e2e.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: simonpasquier

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed No Ginkgo titles were added or changed; the modified tests use static top-level Test names, and dynamic values stay in setup/body.
Test Structure And Quality ✅ Passed No Ginkgo code exists here; the changed t-tests are single-purpose with deferred cleanup and diagnostic assertions, and no timeout regressions were introduced.
Microshift Test Compatibility ✅ Passed No new Ginkgo tests or MicroShift-blocked APIs/namespaces were added; changes are build-tag and error-handling only.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added e2e tests are plain Go tests, not Ginkgo, and only create/delete alert rules via API with namespace/PrometheusRule checks—no multi-node or HA assumptions found.
Topology-Aware Scheduling Compatibility ✅ Passed Only Makefile and e2e test/build-tag changes were touched; no deployment manifests, controllers, or scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were found in the changed e2e files; they only use t.Log/t.Fatalf, and framework.New() returns errors without printing.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Changed e2e tests use cluster env URLs only; no hardcoded IPv4, IP parsing, or public internet hosts were found.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons appear in the changed files; only TLS client config is touched.
Container-Privileges ✅ Passed No changed manifest introduces privileged settings; chart values set runAsNonRoot:true and allowPrivilegeEscalation:false, with no true host* or privileged flags found.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data is logged in the patch; it only adds build tags and direct errors, with no BearerToken/KUBECONFIG/PLUGIN_URL values emitted.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding build tags for e2e tests and removing the ErrSkip skip pattern.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2026
Comment thread Makefile Outdated
@sradco
sradco force-pushed the e2e-build-tags branch 2 times, most recently from ebfb6c7 to dd97929 Compare July 20, 2026 15:15
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>
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@sradco: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@simonpasquier simonpasquier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2026
@PeterYurkovich

Copy link
Copy Markdown
Contributor

/retitle NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern

@openshift-ci openshift-ci Bot changed the title test: use build tags for e2e tests, remove ErrSkip pattern NO-JIRA: use build tags for e2e tests, remove ErrSkip pattern Jul 21, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@sradco: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Adds //go:build e2e constraint to all e2e test files and the framework so go test ./... works locally without a cluster
  • Removes the ErrSkip sentinel pattern — framework.New() returns a direct error if KUBECONFIG or PLUGIN_URL are unset; tests t.Fatal immediately
  • CI runs e2e via make test-e2e which passes -tags e2e
  • Adds unit-test Makefile alias (delegates to test-backend) for clarity

Test plan

  • go test ./pkg/... ./internal/... passes locally (e2e files excluded)
  • go build ./... succeeds (e2e files excluded without tag)
  • CI go-tests job passes (uses make test-backend)
  • CI e2e-management-api job passes (uses make test-e2e with -tags e2e)

Signed-off-by: Shirly Radco sradco@redhat.com

Made with Cursor

Summary by CodeRabbit

  • Tests
  • Added a dedicated command for running backend unit tests.
  • End-to-end tests now run explicitly with the E2E test configuration.
  • E2E tests and supporting helpers are isolated from standard test runs.
  • Missing E2E configuration now produces clear test failures instead of silently skipping tests.

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 21, 2026
@PeterYurkovich

Copy link
Copy Markdown
Contributor

/approve
/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Jul 21, 2026
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[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

Details 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2026
@PeterYurkovich
PeterYurkovich merged commit d8451a1 into openshift:main-alerts-management-api Jul 21, 2026
10 of 11 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants