Skip to content

test(playwright-config): bring playwright.config.js into the coverage report - #733

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-playwright-config
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-playwright-config

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/playwright-config.test.mjs.

playwright.config.js was the only executable JavaScript file at the repository
root missing from 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 imported
playwright.config.js, so Node never instrumented it and the
test:unit:coverage:check gate could not see it at all.

The new test follows the loadConfig(env) cache-busting pattern already
established in tests/site-config.test.mjs, re-importing the config under
controlled environment variables so each module-scope branch is observed:

  • E2E_PORT default (3000) and override, asserted across all three places the
    port is interpolated — use.baseURL, webServer.url, and
    webServer.command. Drift between them would hang the suite at startup.
  • CI set, unset, and empty-string, covering the !!/ternary boundary that
    simultaneously switches forbidOnly, retries, reporter, and
    webServer.reuseExistingServer.
  • fullyParallel and trace: 'retain-on-failure'.
  • Exactly one project, carrying the Desktop Chrome device descriptor.
  • testDir names a directory that exists and actually contains .spec.js
    files, so moving or renaming the spec directory fails loudly instead of
    reporting zero tests and exiting successfully.
  • webServer.timeout is a positive, bounded number.

Result

playwright.config.js now appears in the report at 100.00 / 100.00, and src files rises from 5401/5401 to 5432/5432 lines. npm run test:unit:coverage:check (--check 97 --check-source 99) passes, as does
npx prettier --check on the new file.

No production code is touched — the config itself is unchanged.

Scope / overlap

Adds one new test file and nothing else. Disjoint from the e2e specs in #723 and
#729, the shared sandbox helpers in #727, the coverage-report tool in #702 and
#719, the harness files in #706 and #708, and every scripts/ module claimed by
#678, #680, #686, #688, and #693.

Related Issue

Closes #732


Filed by quality agent (hold-gated mode). Human review required.

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

… report

playwright.config.js was the only executable JavaScript file at the
repository root absent from the test:unit:coverage report. Nothing
imported it, so Node never instrumented it and the coverage gate could
not see it at all.

Cover the environment-dependent branches it evaluates at module scope:
E2E_PORT threading into use.baseURL, webServer.url and
webServer.command; the CI-conditional forbidOnly, retries, reporter and
webServer.reuseExistingServer; and testDir agreeing with the directory
that actually holds the spec files.

The config now reports 100.00 / 100.00.

Closes #732

Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@mrbobbytables

Copy link
Copy Markdown
Member

Superseded by #750, which consolidates this and 14 other test-only coverage PRs into a single reviewable change (commit cherry-picked unmodified, authorship and DCO preserved).

@mrbobbytables
mrbobbytables deleted the quality/test-playwright-config branch September 28, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant