-
Couldn't load subscription status.
- Fork 2.1k
feat(e2e-testing): record playwright traces for CI failures #5923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
cac16bc to
5663920
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR enables Playwright trace recording for failed tests in CI, which will significantly improve debugging capabilities for test failures. The implementation is straightforward and follows Playwright best practices.
Key Changes:
- Added
trace: "retain-on-failure"to Playwright config to capture trace files only when tests fail - Configured
outputDir: "test-results"to ensure traces are saved in the correct location - Updated GitHub workflow artifact upload to include trace files with updated comment
- Minor whitespace cleanup in workflow file (trailing spaces removed)
The test-results directory is already properly gitignored, and the artifact retention is set to 30 days, which is appropriate for debugging purposes.
Confidence Score: 5/5
- This PR is safe to merge with no risk - it only adds test debugging capabilities
- The changes are minimal, well-scoped, and follow Playwright's official documentation. The trace recording only activates on test failures, adding no overhead to passing tests. The configuration is already supported by the existing gitignore rules, and the workflow changes are purely additive.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| web/playwright.config.ts | 5/5 | Added trace recording on test failure with proper output directory configuration - clean implementation |
| .github/workflows/pr-playwright-tests.yml | 5/5 | Updated artifact upload comment and path to include trace files - whitespace cleanup included |
Sequence Diagram
sequenceDiagram
participant GH as GitHub Actions
participant PW as Playwright Test Runner
participant FS as File System
participant Artifact as Artifact Storage
GH->>GH: Start Docker containers
GH->>GH: Install Playwright & dependencies
GH->>PW: Run tests with config
alt Test Passes
PW->>PW: Execute test
PW->>GH: Report success (no trace)
else Test Fails
PW->>PW: Execute test
PW->>FS: Record trace to test-results/
PW->>GH: Report failure
end
GH->>FS: Check test-results/ directory
FS->>GH: Return test results + trace.zip files
GH->>Artifact: Upload all files to artifact storage
Artifact->>Artifact: Retain for 30 days
2 files reviewed, no comments
Description
This change enables recording trace files for failing playwright tests in CI. These trace files are great for debugging failed tests. https://playwright.dev/docs/trace-viewer
How Has This Been Tested?
ci
Additional Options