feat(coverage): support web coverage reports in test_with_coverage - #2448
feat(coverage): support web coverage reports in test_with_coverage#2448kevmoo wants to merge 24 commits into
Conversation
Add support for web (V8 / Chrome) coverage collection, parsing, and formatting in package:coverage. - Delegate test execution in test_with_coverage.dart to dart test --coverage with -p / --platform support. - Auto-detect raw Chrome V8 coverage JSON lists in HitMap.parseFiles. - Add pre-flight package:test verification and file: URI normalization via package:package_config. - Add explicit line-hit assertions in integration and unit tests. - Update GitHub Actions workflow to run VM and Chrome tests in CI. Fixes #2434
Package publishingIf you have publishing permissions, you can use the links below to publish the changes after merging this PR.
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
There was a problem hiding this comment.
Code Review
This pull request adds support for collecting and formatting Web (V8 / Chrome) coverage reports in test_with_coverage via a new -p / --platform flag, and adds support for parsing raw Chrome V8 coverage JSON lists in HitMap.parseFiles. The review feedback highlights several critical issues: the raw Chrome V8 precise coverage JSON list parsing path is currently non-functional because the source and source map providers are hardcoded to return null; if no coverage files are found, the output JSON is not written, which will cause subsequent formatting steps to crash; the workspace filtering logic uses a fragile substring check for file: URIs; the new test in chrome_test.dart does not actually exercise the raw Chrome V8 coverage list parsing path; and an accumulator in test_util.dart should be explicitly typed to avoid runtime type errors.
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for collecting and formatting Web (V8 / Chrome) coverage reports in test_with_coverage using the -p/--platform flag, along with parsing raw Chrome V8 coverage JSON lists in HitMap.parseFiles. It also adds pre-flight verification for package:test and URI normalization. Feedback on the changes includes a suggestion to warn users if package_config.json is completely missing (rather than only when package:test is absent), and to simplify a redundant path containment check.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for collecting and formatting Web (V8 / Chrome) coverage reports in test_with_coverage using a new -p / --platform flag. It also enables parsing of raw Chrome V8 coverage JSON lists in HitMap.parseFiles and introduces pre-flight verification using package_config. There are no review comments, so I have no additional feedback to provide.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for collecting and formatting Web (V8 / Chrome) coverage reports via a new --platform flag, along with parsing raw Chrome V8 coverage JSON lists in HitMap.parseFiles. It also adds pre-flight package verification and URI normalization. The review feedback suggests several robustness and performance improvements, including using Uri.tryParse and checking pathSegments to avoid runtime crashes, using .whereType instead of .cast to safely parse JSON lists, and consistently converting scopes to a Set for O(1) lookups.
|
/gemini review |
PR HealthUnused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with
Coverage
|
| File | Coverage |
|---|---|
| pkgs/coverage/benchmark/many_isolates.dart | 💔 Not covered |
| pkgs/coverage/benchmark/run_benchmarks.dart | 💔 Not covered |
| pkgs/coverage/bin/collect_coverage.dart | 💔 Not covered |
| pkgs/coverage/bin/format_coverage.dart | 💔 Not covered |
| pkgs/coverage/bin/test_with_coverage.dart | 💔 Not covered |
| pkgs/coverage/lib/src/chrome.dart | 💚 98 % ⬆️ 0 % |
| pkgs/coverage/lib/src/collect.dart | 💔 84 % ⬇️ 3 % |
| pkgs/coverage/lib/src/coverage_options.dart | 💚 100 % |
| pkgs/coverage/lib/src/coverage_percentage.dart | 💚 100 % |
| pkgs/coverage/lib/src/formatter.dart | 💚 97 % ⬆️ 0 % |
| pkgs/coverage/lib/src/hitmap.dart | 💔 91 % ⬇️ 1 % |
| pkgs/coverage/lib/src/isolate_paused_listener.dart | 💔 97 % ⬇️ 1 % |
| pkgs/coverage/lib/src/resolver.dart | 💚 95 % ⬆️ 0 % |
| pkgs/coverage/lib/src/run_and_collect.dart | 💚 69 % |
| pkgs/coverage/lib/src/util.dart | 💚 100 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check.
License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
| Files |
|---|
| no missing headers |
All source files should start with a license header.
This check can be disabled by tagging the PR with skip-license-check.
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
…and ensure clean process exit
…efine RPCError handling
…h expanded logging
|
I'm breaking this up into many PRs. First one: #2452 |
📌 Plan: Splitting PRs for ReviewabilityTo make code review as clean and focused as possible, the work on this branch is being split into three stacked/sequential PRs:
|
Does this mean this one can be closed @kevmoo ? |
|
Can we keep it open for one more week? So I can track this who arc? |
|
Sure, I was just looking through the PRs to clean stuff up. |
Add support for web (V8 / Chrome) coverage collection, parsing, and formatting in package:coverage.
Fixes #2434
Fixes #471