Skip to content

[quality] playwright.config.js has zero unit coverage — it is absent from the coverage report entirely #732

Description

@hivecommons-hive

Finding

playwright.config.js is the only executable JavaScript file at the repository
root that does not appear in the npm run test:unit:coverage report.
docusaurus.config.js and sidebars.js are both reported at 100.00 / 100.00,
because tests/site-config.test.mjs imports them. Nothing imports
playwright.config.js, so Node never instruments it and the file is invisible
to the coverage gate rather than merely uncovered by it.

Evidence

  • Unit: TZ=UTC node tests/tools/coverage-report.mjs at b54cf81
    (npm run test:unit:coverage). playwright.config.js produces no row. Every
    other source file under src/ and scripts/, plus docusaurus.config.js and
    sidebars.js, does. Reproduce with:
    npm ci && npm run test:unit:coverage | grep playwright — no output.
  • End-to-end: the config is loaded and executed on every
    npm run test:e2e run, but no CI workflow invokes test:e2e ([quality] Playwright e2e suite is never run in CI — tests/e2e/smoke.spec.js has no workflow #672), so no
    machine-readable end-to-end coverage data exists for this revision. No claim
    of missing end-to-end coverage is made here.
  • Limitation: the two sources cannot be combined — Playwright emits no
    statement-level coverage for its own configuration module — so they are
    reported separately above.

Why it matters

The config is not inert data; it branches on the environment at module scope,
and each branch silently changes how the end-to-end suite behaves:

  • E2E_PORT (default 3000) is interpolated into three separate places —
    use.baseURL, webServer.url, and webServer.command. If those ever drift
    apart, Playwright waits on one URL while the server listens on another and the
    whole suite times out at startup.
  • CI switches forbidOnly, retries, reporter, and
    webServer.reuseExistingServer simultaneously. A regression in the
    forbidOnly or reuseExistingServer branch is invisible locally and only
    shows up as test.only silently narrowing a CI run, or as CI reusing a stale
    server.
  • testDir is a hardcoded string (tests/e2e). If the spec directory is ever
    moved or renamed, Playwright reports zero tests and exits successfully.

None of these are currently asserted anywhere.

Recommendation

Add tests/playwright-config.test.mjs that imports the config under controlled
environments, following the existing loadConfig(env) cache-busting pattern
already established in tests/site-config.test.mjs for docusaurus.config.js.
It should assert:

  • E2E_PORT unset yields http://localhost:3000 in use.baseURL,
    webServer.url, and webServer.command
  • E2E_PORT set threads the same custom port through all three
  • CI unset gives forbidOnly: false, retries: 0, reporter: 'list',
    reuseExistingServer: true
  • CI set gives forbidOnly: true, retries: 1, reporter: 'github',
    reuseExistingServer: false
  • an empty CI value is treated as not-CI (the !!/ternary boundary)
  • fullyParallel and trace: 'retain-on-failure' are set
  • exactly one project is declared and it carries the Desktop Chrome device
    descriptor
  • testDir names a directory that exists and actually contains .spec.js
    files
  • webServer.timeout is a positive, bounded number

That brings playwright.config.js into the report at 100.00 / 100.00, so the
existing npm run test:unit:coverage:check gate starts protecting it.

Scope

Single file, single PR. This does not touch tests/e2e/*.spec.js (#723, #729),
the shared sandbox helpers (#727), the coverage-report tool (#702, #719), or any
scripts/ module claimed by #678, #680, #686, #688, or #693.

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: b54cf81

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions