Skip to content

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

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

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.

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>
@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: 773971a3-55b5-48d3-8747-1c9a8544d7f4

📥 Commits

Reviewing files that changed from the base of the PR and between 22aba7f and 3e75364.

📒 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

  • Bug Fixes
    • Added a readiness synchronization step to image-related QA tests, ensuring scanner integration is available before starting image/policy and management scenarios.
    • Updated multiple test specifications to wait for scanner integration during setup, reducing intermittent failures when the required image services aren’t ready yet.

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 identifies the main change: waiting for scanner availability before E2E image scans.
Description check ✅ Passed The description covers the required sections and explains the change, validation, and user-facing docs.
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 3e75364. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-459-g3e753646cc

@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 (cbaf8e9) to head (3e75364).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21638      +/-   ##
==========================================
- Coverage   50.39%   50.34%   -0.05%     
==========================================
  Files        2846     2846              
  Lines      218351   218351              
==========================================
- Hits       110030   109923     -107     
- Misses     100340   100423      +83     
- Partials     7981     8005      +24     
Flag Coverage Δ
go-unit-tests 50.34% <ø> (-0.05%) ⬇️

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted do-not-merge/work-in-progress e2e-nongroovy-tests Triggers GHA-based e2e-nongroovy-tests on draft PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant