Skip to content

feat(coverage): generate html coverage report without istanbul libs - #42784

Open
Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:mainfrom
yury-s:coverage-html-report
Open

Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:mainfrom
yury-s:coverage-html-report

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • coverage reporter writes a self-contained index.html with per-file annotated sources, no istanbul report libs needed
  • the view lives in html-reporter/src/coverage as a reusable component styled like the html report, built as a second vite environment
  • html report zip loader shared via ZipReport, summary helpers moved to @isomorphic/istanbulCoverage

The coverage reporter now writes a self-contained index.html rendered by
a CoverageView component in html-reporter/src/coverage, styled like the
html report and reusable for embedding into it later.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 failed
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @macos-latest-node22
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @ubuntu-latest-node20
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @windows-latest-node22
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @ubuntu-latest-node24
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @ubuntu-latest-node22
❌ [playwright-test] › coverage.spec.ts:134 › should generate html coverage report @ubuntu-latest-node26

5 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:373 › should produce network events, routing, and annotations for Service Worker `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node20`

52026 passed, 1250 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the CI failures here.

🔴 The failure is caused by this PR

coverage.spec.ts:134 › should generate html coverage report is the test this PR adds, and it fails on all six OS/Node combinations at sha 2cc4217. It exercises exactly the feature under change, so this is a real failure, not noise.

Details

Caused by this PR

  • [playwright-test] › coverage.spec.ts:134 › should generate html coverage report (@ubuntu-latest-node20/22/24/26, @macos-latest-node22, @windows-latest-node22) — added by this diff in tests/playwright-test/coverage.spec.ts, asserting against the new packages/coverage-report view: coverage-metric-statements, coverage-file, coverage-source, .coverage-line-count, .coverage-branch-marker, .coverage-segment-statement. It fails identically on every platform and Node version, with no retry recovery — that rules out an environment or timing story and points at the generated report or the test's expectations. The test is new, so there's no run history to compare against and a flake call isn't available. Two things worth checking: whether the coverage reporter's new index.html really is self-contained when built as the second vite environment (a missing bundle would leave the page blank and every getByTestId would fail), and whether utils.serveFolder is actually exported from playwright-core/lib/coreBundle — the rest of the tree reaches it via @utils/httpServer, so a bad import would throw before the first assertion.

Note the individual test jobs all report green; the failures only surface in the merged report, so the raw error text isn't in the job logs.

Pre-existing flake / infra

  • The 5 flaky entries — library/chromium/chromium.spec.ts:373, library/beforeunload.spec.ts:130, library/browsercontext-cookies-third-party.spec.ts:257 and :470, page/page-event-request.spec.ts:181 — all passed on retry and sit in service worker, dialog, cookie and request code this PR doesn't touch. Nothing to triage there.

Merge workflow run.

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-session.spec.ts:54 › idle timeout shuts the session down @mcp-windows-latest-firefox

8691 passed, 1474 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the CI failures here.

🟢 The one failure is a known flake — the PR is clear

mcp/cli-session.spec.ts:54 › idle timeout shuts the session down fails only on mcp-windows-latest-firefox, and it fails there with the identical error on other PRs and on pushes to main.

Details

Pre-existing flake / infra

The diff also doesn't reach it. This PR is confined to the coverage/HTML reporter — packages/coverage-report, packages/html-reporter/src/index.tsx, packages/web/src/zipReport.ts, packages/isomorphic/istanbulCoverage.ts, packages/playwright/src/reporters/* and build config. The MCP CLI session lifecycle shares no code with any of that.

Merge workflow run.

Triaged by the Playwright bot - agent run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant