Skip to content

[coverage] Support collecting and formatting Web (V8 / Chrome) coverage reports #2434

Description

@kevmoo

Currently, package:coverage utilities (such as test_with_coverage, collect_coverage, and format_coverage) are designed around the Dart VM Service API and gather coverage metrics exclusively from Dart VM isolates.

When running tests targeting web or browser platforms (e.g. dart test -p chrome), package:test collects V8 JavaScript JSON coverage files (e.g. my_test.dart.chrome.json). However:

  1. dart run coverage:test_with_coverage does not support collecting or orchestrating web/Chrome test runs.
  2. Running collect_coverage against a -p chrome test run produces an empty VM coverage file ({"type":"CodeCoverage","coverage":[]}).
  3. Collecting code coverage across full-stack applications (where backend Shelf SSR runs on the VM and frontend components run in V8) requires manual multi-step compilation and formatting.

It would be fantastic if package:coverage (test_with_coverage and format_coverage) could natively support collecting, parsing, and unifying Web/V8 JS coverage data alongside Dart VM coverage into a single LCOV report.

Related context / demand: See also #471 where developers run into hangs attempting to use --coverage with -p chrome.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions