test(playwright-config): bring playwright.config.js into the coverage report - #733
Closed
hivecommons-hive[bot] wants to merge 1 commit into
Closed
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
… 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>
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 Hive will automatically remove the |
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). |
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.
Test Improvement
Adds
tests/playwright-config.test.mjs.playwright.config.jswas the only executable JavaScript file at the repositoryroot missing from the
npm run test:unit:coveragereport.docusaurus.config.jsand
sidebars.jsare both reported at 100.00 / 100.00 becausetests/site-config.test.mjsimports them; nothing importedplaywright.config.js, so Node never instrumented it and thetest:unit:coverage:checkgate could not see it at all.The new test follows the
loadConfig(env)cache-busting pattern alreadyestablished in
tests/site-config.test.mjs, re-importing the config undercontrolled environment variables so each module-scope branch is observed:
E2E_PORTdefault (3000) and override, asserted across all three places theport is interpolated —
use.baseURL,webServer.url, andwebServer.command. Drift between them would hang the suite at startup.CIset, unset, and empty-string, covering the!!/ternary boundary thatsimultaneously switches
forbidOnly,retries,reporter, andwebServer.reuseExistingServer.fullyParallelandtrace: 'retain-on-failure'.testDirnames a directory that exists and actually contains.spec.jsfiles, so moving or renaming the spec directory fails loudly instead of
reporting zero tests and exiting successfully.
webServer.timeoutis a positive, bounded number.Result
playwright.config.jsnow appears in the report at 100.00 / 100.00, andsrc filesrises from 5401/5401 to 5432/5432 lines.npm run test:unit:coverage:check(--check 97 --check-source 99) passes, as doesnpx prettier --checkon 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