Skip to content

ROX-32158: Add E2E tests for label-based policy scoping#19756

Open
AlexVulaj wants to merge 6 commits intomasterfrom
AlexVulaj/ROX-32158-label-scoped-policies-integration-tests
Open

ROX-32158: Add E2E tests for label-based policy scoping#19756
AlexVulaj wants to merge 6 commits intomasterfrom
AlexVulaj/ROX-32158-label-scoped-policies-integration-tests

Conversation

@AlexVulaj
Copy link
Copy Markdown
Contributor

Description

This PR adds comprehensive integration test coverage for the label-based policy scoping feature (ROX-32158), specifically testing cluster_label and namespace_label fields in policy scope objects.

The label-based policy scoping feature was previously implemented end-to-end but lacked integration test coverage for regression protection. This PR addresses that gap by adding both Go E2E tests and Groovy integration tests for admission control.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • Will rely on CI to validate tests pass
  • Tests cover all of the manual test plans I used for the PRs in this feature

@AlexVulaj AlexVulaj requested a review from janisz as a code owner April 1, 2026 17:11
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.60%. Comparing base (a73bc3a) to head (89a8605).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #19756    +/-   ##
========================================
  Coverage   49.59%   49.60%            
========================================
  Files        2763     2763            
  Lines      208167   208271   +104     
========================================
+ Hits       103250   103312    +62     
- Misses      97252    97292    +40     
- Partials     7665     7667     +2     
Flag Coverage Δ
go-unit-tests 49.60% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Apr 1, 2026

Images are ready for the commit at 5a354f7.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-525-g5a354f7948.

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at 3ae3dca.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-525-g3ae3dcaebc.

@AlexVulaj AlexVulaj force-pushed the AlexVulaj/ROX-32158-label-scoped-policies-integration-tests branch 10 times, most recently from 5a354f7 to f83fbcf Compare April 2, 2026 14:08
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.

Looks like we already have non groovy test so maybe we don't need this test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's a slight difference here in what each is testing. the Go tests are verifying that label-scoped policies detect violations and generate alerts, while the Groovy tests are verifying that label-scoped policies enforce at admission time and actually block deployments from being created.

If there's an easier way to do this (and remove the groovy tests entirely) I'd be happy to remove them, but I do think the coverage is important in one place or another.

@AlexVulaj AlexVulaj force-pushed the AlexVulaj/ROX-32158-label-scoped-policies-integration-tests branch from c7944d3 to b6f51fe Compare April 2, 2026 15:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🚀 Build Images Ready

Images are ready for commit 89a8605. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-548-g89a860597e

@AlexVulaj
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 3, 2026

@AlexVulaj: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-nongroovy-e2e-tests 89a8605 link true /test gke-nongroovy-e2e-tests
ci/prow/gke-qa-e2e-tests 89a8605 link false /test gke-qa-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests 89a8605 link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-21-nongroovy-e2e-tests 89a8605 link false /test ocp-4-21-nongroovy-e2e-tests
ci/prow/ocp-4-12-qa-e2e-tests 89a8605 link false /test ocp-4-12-qa-e2e-tests
ci/prow/ocp-4-21-qa-e2e-tests 89a8605 link false /test ocp-4-21-qa-e2e-tests

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.

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