fix(ci): let the runtime specs deploy before global-setup polls their route - #5136
Conversation
… route
showcase-runtime fails in globalSetup before a single test runs:
Timeout 120000ms exceeded while waiting on the predicate
at waitForRhdhReady (playwright/utils/wait-for-rhdh-ready.ts:31)
at globalSetup (playwright/global-setup.ts:32)
The runtime specs create their own namespace and deployment via
ensureRuntimeDeployed() in beforeAll, and global-setup.ts is written for that:
it deploys when BASE_URL is empty and RUNTIME_AUTO_DEPLOY is true, and
ensureRuntimeDeployed() sets BASE_URL itself once the route exists.
CI never reached that path. run_tests exports its optional url argument as
BASE_URL, and both runtime callers passed the route, so BASE_URL was always
pre-set: the deploy branch was skipped and globalSetup polled a route nothing
had created yet. It timed out after 120s, so the tests that would have done the
deploying never ran - a deadlock, not a slow deployment. RUNTIME_AUTO_DEPLOY was
referenced only in global-setup.ts and set by no CI script, so the branch was
dead.
Stop passing the URL and set RUNTIME_AUTO_DEPLOY. Both callers are fixed: helm
(ocp-nightly.sh) and operator (ocp-operator.sh). Dropping the hard-coded route
is safe for both because runtime-deploy.ts already branches on the install
method and returns the matching URL - `<release>-developer-hub-<ns>` for helm,
`backstage-<release>-<ns>` for the operator, identical to the strings removed
here.
Not reproducible outside CI; verified by reading the call path rather than by
running it. Worth watching the first nightly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
46 rules✅ Skills:
e2e-verify-fix, e2e-diagnose-and-fix✅ Cross-repo context Not relevant to this PR:
redhat-developer/rhdh-plugins Not relevant to this PR:
redhat-developer/rhdh-chart Not relevant to this PR:
redhat-developer/rhdh-operator Not relevant to this PR:
redhat-developer/rhdh-local 1. BASE_URL not set on reuse
|
PR Summary by QodoFix CI deadlock by enabling runtime auto-deploy before Playwright globalSetup waits
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
|
/lgtm |
8c19ff6
into
redhat-developer:main
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5136 +/- ##
=======================================
Coverage 56.03% 56.03%
=======================================
Files 123 123
Lines 2404 2404
Branches 553 553
=======================================
Hits 1347 1347
Misses 1051 1051
Partials 6 6
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|



Problem
showcase-runtimefails inglobalSetup, before a single test runs:Root cause — a deadlock, not a slow deployment
The runtime specs create their own namespace and deployment:
config-map.spec.tscallsensureRuntimeDeployed()inbeforeAll.global-setup.tsis written for exactly that, and documents it:CI never reached the second branch.
testing::run_testsexports its optional url argument asBASE_URL, and both runtime callers passed the route:So
BASE_URLwas always pre-set. The deploy branch was skipped, andglobalSetuppolled a route that nothing had created yet. It timed out after 120s, which meant the tests that would have done the deploying never ran.RUNTIME_AUTO_DEPLOYis referenced only inglobal-setup.tsand set by no CI script, so that branch was dead code.Fix
Stop passing the URL and set
RUNTIME_AUTO_DEPLOY=true, so the documented path does the work.ensureRuntimeDeployed()setsBASE_URLitself once the route exists, and already waits for the deployment (waitForDeploymentReady, 600s) — so the readiness gate is not lost, it just happens after the thing exists.Both callers are affected and both are fixed:
jobs/ocp-nightly.sh(helm)jobs/ocp-operator.sh(operator)Dropping the hard-coded routes is safe because
runtime-deploy.tsalready branches on the install method and returns the matching URL —<release>-developer-hub-<ns>for helm,backstage-<release>-<ns>for the operator, byte-identical to the strings removed here.Verification
shellcheckand.ciprettier clean.Honest caveat: this is not reproducible outside CI, so it was verified by reading the call path (
run_tests→BASE_URL→global-setup→runtime-deploy), not by running it. Worth watching the first nightly after merge.Side note, not fixed here
When runtime tests fail, no pod logs are collected —
run_runtime_config_change_testscallstesting::run_testsdirectly, whiletesting::check_and_testis what wraps failures withsave_all_pod_logs. That is why the failing run'sshowcase-runtime/artifacts contain only the report and a 112-byte junit. Worth a follow-up.