fix(tests): skip Playwright tests when browser not installed#77
Merged
Conversation
Two test suites call chromium.launch() in beforeAll, which crashes in CI runners where \`npx playwright install\` hasn't been run. This causes coverage-summary.json to never be written, breaking the Coverage Floor check. Add a hasPlaywright guard using fs.existsSync(chromium.executablePath()) and wrap both describe blocks with describe.skipIf(!hasPlaywright). Tests still run in any environment where Playwright browsers are installed (local dev, dedicated Playwright CI jobs). Co-Authored-By: Claude <noreply@anthropic.com>
|
No issues found. Diff is small and contained — the |
|
No issues found. Diff is small and contained (4-line test-only guard for missing Playwright binary). |
|
Coverage Floor — mode:
Seed-not-yet: floor==0 means coverage is not enforced yet. After this PR merges, the push:main run opens a follow-up PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
nanoclaw Coverage Floor fix — guard Playwright-dependent tests with skipIf
Owned files
src/__tests__/signer-integration.test.tssrc/signer/__tests__/docusign-executor.test.tsProblem
Both files call
chromium.launch()inbeforeAllhooks. When Playwrightbrowsers aren't installed in the CI runner, the launch crashes, the 4 affected
tests fail, and
coverage-summary.jsonis never written → Coverage Floor CIcheck has been red for 8+ days.
Fix
Added
const hasPlaywright = fs.existsSync(chromium.executablePath())andwrapped both top-level
describeblocks withdescribe.skipIf(!hasPlaywright).Tests still run locally and in any runner where
npx playwright installwas run.Acceptance command + output
Coverage delta
Before: N/A (coverage-summary.json was never written — check was always failing)
After: Coverage Floor CI check unblocked; tests skip gracefully
Auto-merge rationale
Test-only change; no production code touched. Fixes a CI infrastructure failure.
Codex pre-review
skipped — sub-50-LOC trivial change
HUMAN_READABLE_SUMMARY
Two Playwright-dependent test suites were crashing the CI coverage run by calling
chromium.launch() in environments where browsers aren't installed. This PR adds a
one-line existsSync guard and wraps both describe blocks with describe.skipIf so
they skip gracefully instead of crashing. Coverage Floor CI will be unblocked once merged.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com