Skip to content

fix(tests): skip Playwright tests when browser not installed#77

Merged
topcoder1 merged 1 commit into
mainfrom
fix/playwright-skipif-guard
May 22, 2026
Merged

fix(tests): skip Playwright tests when browser not installed#77
topcoder1 merged 1 commit into
mainfrom
fix/playwright-skipif-guard

Conversation

@topcoder1

Copy link
Copy Markdown
Owner

Task

nanoclaw Coverage Floor fix — guard Playwright-dependent tests with skipIf

Owned files

  • src/__tests__/signer-integration.test.ts
  • src/signer/__tests__/docusign-executor.test.ts

Problem

Both files call chromium.launch() in beforeAll hooks. When Playwright
browsers aren't installed in the CI runner, the launch crashes, the 4 affected
tests fail, and coverage-summary.json is never written → Coverage Floor CI
check has been red for 8+ days.

Fix

Added const hasPlaywright = fs.existsSync(chromium.executablePath()) and
wrapped both top-level describe blocks with describe.skipIf(!hasPlaywright).
Tests still run locally and in any runner where npx playwright install was run.

Acceptance command + output

npx vitest run --reporter=verbose 2>&1 | tail -10
# (shows skipped instead of crashed when no browser installed)

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

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>
@topcoder1 topcoder1 enabled auto-merge (squash) May 22, 2026 03:13
@github-actions github-actions Bot added the risk:sensitive Risk class: sensitive label May 22, 2026
@claude

claude Bot commented May 22, 2026

Copy link
Copy Markdown

No issues found. Diff is small and contained — the executablePath() + existsSync guard is correct Playwright idiom and describe.skipIf properly suppresses the crashing beforeAll hooks.

@claude

claude Bot commented May 22, 2026

Copy link
Copy Markdown

No issues found. Diff is small and contained (4-line test-only guard for missing Playwright binary).

@topcoder1 topcoder1 merged commit 01d9387 into main May 22, 2026
15 checks passed
@topcoder1 topcoder1 deleted the fix/playwright-skipif-guard branch May 22, 2026 03:15
@github-actions

Copy link
Copy Markdown

Coverage Floor — mode: seed

metric value
measured 71.3%
floor (current) 0.0%
target 80.0%
last bumped 2026-05-13

Seed-not-yet: floor==0 means coverage is not enforced yet. After this PR merges, the push:main run opens a follow-up PR chore(coverage): seed floor at X.X% to commit the real value. From then on, future PRs run in enforce mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:sensitive Risk class: sensitive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant