CONSOLE-5197: Collect Playwright test artifacts for Prow CI#16453
CONSOLE-5197: Collect Playwright test artifacts for Prow CI#16453stefanonardo wants to merge 1 commit into
Conversation
|
@stefanonardo: This pull request references CONSOLE-5197 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: stefanonardo The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThe Playwright E2E test runner script gains artifact preservation. A new Suggested reviewers
🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/integration-tests/test-playwright-e2e.sh`:
- Around line 83-90: The EXIT trap currently runs copyArtifacts and any failure
there can overwrite the original Playwright exit code; modify copyArtifacts to
capture the incoming exit status at the start (e.g., exit_code=$?), perform the
artifact copy as a best-effort (suppress or log cp errors rather than returning
non-zero), and at the end restore the original status by exiting with exit_code
so the Playwright test exit code (from the process that triggered the trap) is
preserved; reference the copyArtifacts function, ARTIFACT_DIR and the cp of
test-results invoked by the trap copyArtifacts EXIT.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 4b5f9cf4-20ec-4bcf-a561-bbb12a57e09b
📒 Files selected for processing (1)
frontend/integration-tests/test-playwright-e2e.sh
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit inference engine (STYLEGUIDE.md)
Use lowercase dash-separated names for all files (to avoid git issues with case-insensitive file systems)
Files:
frontend/integration-tests/test-playwright-e2e.sh
🔇 Additional comments (1)
frontend/integration-tests/test-playwright-e2e.sh (1)
101-101: LGTM!
b89c32a to
6718c9c
Compare
6718c9c to
f97e6fd
Compare
|
@stefanonardo: all tests passed! 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. |
Analysis / Root cause:
The Playwright CI test runner (
test-playwright-e2e.sh) was not copying test results to$ARTIFACT_DIR, so Prow had no artifacts to display in the job results page. Unlike the Cypress runner which has atrap "copyArtifacts; generateReport" EXIT, the Playwright script had no equivalent. Additionally, usingexecto launch Playwright meant any trap would never fire.Solution description:
EXITtrap intest-playwright-e2e.shthat copies thetest-results/directory (JUnit XML, traces, screenshots, videos) to$ARTIFACT_DIR/playwright-test-resultsexec "$playwright_bin" test "$@"with a direct invocation so the EXIT trap actually firesScreenshots / screen recording:
N/A — CI script change, no visual impact.
Test setup:
Run a Playwright E2E job in Prow and verify artifacts appear in the job results page.
Test cases:
playwright-test-results/directoryBrowser conformance:
N/A — CI infrastructure change.
Additional info:
Related Prow job with missing artifacts: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_release/78021/rehearse-78021-pull-ci-openshift-console-main-e2e-playwright/2055259618824687616
Summary by CodeRabbit