Skip to content

ROX-35308: Wait for scanner before scanning in E2E#21638

Open
c-du wants to merge 2 commits into
masterfrom
cong/server-error
Open

ROX-35308: Wait for scanner before scanning in E2E#21638
c-du wants to merge 2 commits into
masterfrom
cong/server-error

Conversation

@c-du

@c-du c-du commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

After removing the testBegin phase (PR #21387), VulnMgmtSACTest no longer acts as an accidental scanner warm-up buffer. Tests that scan images now start before Scanner has registered with Central, failing with "no image scanners are integrated".

Add ImageService.waitForScannerIntegration() that polls Central's image integration API until a scanner is available (up to 5 minutes), and call it from AdmissionControllerTest and ImageManagementTest setupSpec.

Also fixes ROX-35262.

User-facing documentation

  • CHANGELOG.md is updated OR update is not needed
  • documentation PR is created and is linked above OR is not needed

Testing and quality

  • the change is production ready
  • CI results are inspected

Automated testing

  • modified existing tests

How I validated my change

Cannot be tested locally -- this is a CI timing issue where Scanner takes 15+ minutes to become ready in GKE E2E test clusters. The change uses the same evaluateWithRetry pattern already used throughout the test suite and calls an existing API (getImageIntegrations). Validation will be done by observing CI results after merge.

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 321b2611-ca4f-4e7f-b465-e38604dc60f4

📥 Commits

Reviewing files that changed from the base of the PR and between 23f744e and 3775d95.

📒 Files selected for processing (1)
  • qa-tests-backend/src/test/groovy/AdmissionControllerTest.groovy
🚧 Files skipped from review as they are similar to previous changes (1)
  • qa-tests-backend/src/test/groovy/AdmissionControllerTest.groovy

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Improved test reliability by waiting for image scanner integration readiness before running admission and image management test suites.
    • Added retry handling and status logging while scanner services become available.

Walkthrough

Adds a retrying helper that waits for a SCANNER-category image integration, then invokes it during setup in AdmissionControllerTest and ImageManagementTest.

Changes

Scanner integration readiness check

Layer / File(s) Summary
waitForScannerIntegration helper
qa-tests-backend/src/main/groovy/services/ImageService.groovy
Imports ImageIntegrationCategory and adds a retry-based helper that filters image integrations for the SCANNER category, asserts availability, and logs the integration name.
Test setup wiring
qa-tests-backend/src/test/groovy/AdmissionControllerTest.groovy, qa-tests-backend/src/test/groovy/ImageManagementTest.groovy
Both specifications call ImageService.waitForScannerIntegration() from setupSpec() before continuing setup.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: waiting for scanner integration before E2E scans.
Description check ✅ Passed The description follows the template closely and includes the required sections, checklist items, and validation notes.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cong/server-error

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 3775d95. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-461-g3775d951a5

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.34%. Comparing base (48fb5cf) to head (3775d95).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21638      +/-   ##
==========================================
- Coverage   50.39%   50.34%   -0.06%     
==========================================
  Files        2846     2846              
  Lines      218351   218351              
==========================================
- Hits       110034   109924     -110     
- Misses     100336   100424      +88     
- Partials     7981     8003      +22     
Flag Coverage Δ
go-unit-tests 50.34% <ø> (-0.06%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@c-du c-du added the e2e-nongroovy-tests Triggers GHA-based e2e-nongroovy-tests on draft PRs label Jul 10, 2026
@c-du

c-du commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

/test admission-controller-e2e-tests
/test image-management-e2e-tests

@c-du

c-du commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

/test gke-qa-e2e-tests

Removing the testBegin phase (PR #21387) eliminated VulnMgmtSACTest as
an accidental scanner warm-up buffer. Tests that scan images now start
before Scanner has registered with Central, failing with "no image
scanners are integrated".

Add ImageService.waitForScannerIntegration() that polls Central's
image integration API until a scanner is available, and call it from
AdmissionControllerTest and ImageManagementTest setupSpec.

Partially AI-generated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@c-du c-du force-pushed the cong/server-error branch from 3e75364 to 23f744e Compare July 10, 2026 20:42
@c-du c-du changed the title ROX-35308: wait for scanner before scanning in E2E ROX-35308: Wait for scanner before scanning in E2E Jul 10, 2026
@c-du c-du added the qa-e2e-tests Run QA BAT E2E tests on KinD + GKE label Jul 10, 2026
@c-du c-du marked this pull request as ready for review July 10, 2026 21:04
@c-du c-du requested a review from janisz as a code owner July 10, 2026 21:04
@c-du

c-du commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

/test gke-qa-e2e-tests

@c-du c-du added qa-e2e-tests-gha Enables GHA based execution of qa-e2e-tests. Currently WIP. and removed e2e-nongroovy-tests Triggers GHA-based e2e-nongroovy-tests on draft PRs labels Jul 10, 2026
@c-du

c-du commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

/test aks-qa-e2e-tests

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

@c-du: 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/ocp-4-22-nongroovy-e2e-tests 3775d95 link false /test ocp-4-22-nongroovy-e2e-tests
ci/prow/gke-ui-e2e-tests 3775d95 link true /test gke-ui-e2e-tests
ci/prow/gke-upgrade-tests 3775d95 link false /test gke-upgrade-tests
ci/prow/gke-nongroovy-e2e-tests 3775d95 link true /test gke-nongroovy-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests 3775d95 link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-21-nongroovy-e2e-tests 3775d95 link false /test ocp-4-21-nongroovy-e2e-tests
ci/prow/gke-qa-e2e-tests 3775d95 link false /test gke-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

ai-assisted qa-e2e-tests Run QA BAT E2E tests on KinD + GKE qa-e2e-tests-gha Enables GHA based execution of qa-e2e-tests. Currently WIP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant