Skip to content

test(coverage): report all shipped source honestly#235

Merged
benvinegar merged 1 commit into
mainfrom
test/honest-coverage-reporting
Jul 26, 2026
Merged

test(coverage): report all shipped source honestly#235
benvinegar merged 1 commit into
mainfrom
test/honest-coverage-reporting

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • replace loaded-files-only Node coverage with c8 --all coverage across every shipped Node/Pi source root, including currently untouched entrypoints, barrels, demo data, and the Pi extension
  • add a separate Vite/Solid-aware Vitest report that includes every viewer TypeScript/TSX source file, including untested files at 0%
  • keep workerd and Playwright as separate behavioral gates rather than folding incompatible runtimes into a misleading aggregate
  • pin measured baseline floors in CI and document the source/runtime classification

What changed in the numbers

The former Node report showed 95.13% lines because unexecuted source files were absent from its denominator.

The new reports are deliberately separate:

  • Node/Pi: 85.17% statements/lines, 83.4% branches, 94.39% functions
  • Viewer unit coverage: 0.94% statements, 0.72% branches, 0.51% functions, 1.38% lines

The low viewer number is intentional: Playwright behavior is not relabeled as unit coverage, and untested TSX remains visible.

Validation

  • clean npm ci --ignore-scripts with npm 11
  • npm run coverage on Node 22 and Node 24
  • npm run test:worker
  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run security:audit
  • source inventory verified: 26 Node/Pi files, 17 viewer TS/TSX files, and workers/index.ts owned by workerd
  • independent code and architecture reviews completed without blockers

This PR description was generated by Pi using GPT-5.2

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​vitest/​coverage-v8@​4.1.10991007999100
Addedvitest@​4.1.10981007999100
Addedc8@​12.0.09810010089100
Addedjsdom@​27.4.09510010090100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm css-tree is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package-lock.jsonnpm/jsdom@27.4.0npm/css-tree@3.2.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/css-tree@3.2.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm data-urls is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package-lock.jsonnpm/jsdom@27.4.0npm/data-urls@6.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/data-urls@6.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@benvinegar
benvinegar merged commit bd22699 into main Jul 26, 2026
9 checks passed
@benvinegar
benvinegar deleted the test/honest-coverage-reporting branch July 26, 2026 23:42
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