fix(e2e): fix runtime tests for operator deployments and CI reporting#5027
Conversation
|
/test e2e-ocp-operator-nightly |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5027 +/- ##
==========================================
- Coverage 55.39% 54.77% -0.62%
==========================================
Files 122 110 -12
Lines 2365 2147 -218
Branches 544 542 -2
==========================================
- Hits 1310 1176 -134
+ Misses 1049 969 -80
+ Partials 6 2 -4
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
PR Summary by QodoFix runtime e2e tests for operator external DB and CI status reporting
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
c075f6e to
5317bd4
Compare
|
/test operator ocp |
5317bd4 to
53c5379
Compare
|
/test e2e-ocp-operator-nightly |
|
/test e2e-ocp-operator-nightly |
53c5379 to
57668f0
Compare
|
/test e2e-ocp-operator-nightly |
57668f0 to
b98a55d
Compare
|
/test e2e-ocp-operator-nightly |
b98a55d to
02b171a
Compare
|
/test e2e-ocp-operator-nightly |
02b171a to
aaedb2b
Compare
|
/test e2e-ocp-operator-nightly |
|
/agentic_review |
1 similar comment
|
/test e2e-ocp-helm |
1 similar comment
|
/test e2e-ocp-helm |
…rEach
Move the WebSocket teardown workaround (page.goto('about:blank')) from
per-test try/finally blocks into test.afterEach hooks. This is cleaner:
the cleanup is declared once per describe block and applies to all tests
that use the page fixture, without wrapping test bodies.
Assisted-by: OpenCode
For operator deployments, patching POSTGRES_* env vars directly onto the deployment is reverted by operator reconciliation. The external DB tests (Azure DB, RDS) configure postgres-cred secret with connection details, but those values never reached the RHDH container as env vars. Fix: - Add postgres-cred to extraEnvs.secrets in the Backstage CR so the operator injects all its keys as env vars automatically - Skip direct deployment env var patching in prepareForExternalDatabase for operator installs (same pattern as schema-mode setup) Assisted-by: OpenCode
When Prow kills a job (2h timeout) or Playwright hangs, the mark_test_result call at the end of testing::run_tests never executes. This leaves STATUS_TEST_FAILED.txt and STATUS_NUMBER_OF_TEST_FAILED.txt with fewer entries than STATUS_DEPLOYMENT_NAMESPACE.txt, creating misaligned arrays that break downstream reporting (Slack notifications). Fix: write a pessimistic default (failed=true, count=N/A) immediately after registering the test run. The real result overwrites it after Playwright completes. If the job is killed mid-test, the STATUS files still have entries for all registered test runs. To support this, save_status_test_failed and save_status_number_of_test_failed now regenerate the file from the in-memory array instead of appending, making them safe to call multiple times for the same deployment ID. Assisted-by: OpenCode
The regenerate-from-array pattern requires all callers to run in the same shell process because bash associative arrays are not inherited by child processes. Add a comment documenting this constraint so it travels with the code. Also note the bash >= 4.3 requirement for local -n (nameref). Assisted-by: OpenCode
Replace the two different sentinel strings ('N/A' and 'some') with a
single UNKNOWN_FAILURE_COUNT constant defined in test-run-tracker.sh.
Both meant 'failed but count unknown' — the downstream Slack consumer
now only has to handle one sentinel format.
Assisted-by: OpenCode
The secrets list in the Backstage CR merge-patch (postgres-config.ts) was hardcoded separately from generateBackstageCR (runtime-config.ts). If a secret were added to one but not the other, the patch would silently strip it mid-test. Extract the base list into a shared constant so the two stay in sync. Assisted-by: OpenCode
Centralise the JSON merge-patch Content-Type header in a KubeClient method, matching the existing jsonPatchDeployment and updateSecret patterns. Simplifies the call site in addPostgresCredToBackstageCR by removing the trailing positional undefined args. Assisted-by: OpenCode
The suite-level afterEach requests the page fixture for every test, including non-UI ones. This is an intentional tradeoff — the minor overhead of an extra browser context is acceptable vs per-test conditional logic. Assisted-by: OpenCode
The runtime deployment uses a local ./dynamic-plugins/dist/ path for the homepage plugin. Add a comment referencing redhat-developer#4909 so the OCI migration sweep can find this spot. Assisted-by: OpenCode
The try/catch only logged and rethrew — it existed to pair with the finally block that was removed when about:blank cleanup moved to afterEach. Playwright already reports errors with full stacks, so the wrapper adds no value and costs an indent level. Assisted-by: OpenCode
The verbose !== undefined && !== '' check is used instead of || because oxlint's strict-boolean-expressions and prefer-nullish-coalescing rules (pedantic category, set to error) reject || on string operands. Assisted-by: OpenCode
0b55e3f to
01a6062
Compare
|
/test e2e-ocp-operator-nightly |
|
|
/test e2e-ocp-helm-nightly |
|
/test e2e-ocp-helm |
|
/lgtm |
|
@zdrapela: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/test e2e-ocp-helm |
4002fc1
into
redhat-developer:main




Follow-up to #4809. Fixes issues found during CI verification of the runtime tests refactor.
Changes
1. WebSocket teardown hang (
about:blankinafterEach)Move
page.goto('about:blank')from per-testtry/finallyblocks totest.afterEachhooks. RHDH UI establishes WebSocket connections that prevent Playwright from closing the page cleanly — navigating toabout:blankdrops them before teardown.2. External DB tests for operator deployments
postgres-credto the Backstage CR'sextraEnvs.secretsso the operator injectsPOSTGRES_*env vars automaticallyprepareForExternalDatabasefor operator installs (operator reconciliation reverts direct patches)3. CI reporting: pessimistic test status
Write a pessimistic default (
failed=true,count=N/A) immediately after registering a test run. If Prow kills the job mid-test,STATUS_TEST_FAILED.txtandSTATUS_NUMBER_OF_TEST_FAILED.txtstill have entries for all registered test runs — preventing misaligned arrays that break Slack notifications.save_status_test_failedandsave_status_number_of_test_failednow regenerate the file from the in-memory array instead of appending, making them safe to call multiple times for the same deployment ID.Jira: redhat.atlassian.net/browse/RHIDP-9140
Jira: redhat.atlassian.net/browse/RHIDP-9141