Repository navigation
Commit 29df634
authored
feat(coverage): support web coverage reports in test_with_coverage (#2448)
Add support for web (Chrome) coverage collection and formatting in `test_with_coverage`. **VM runs keep the existing collection flow.**
- Add a `-p` / `--platform` flag to `test_with_coverage`. Web (`chrome`) runs delegate to `dart test --coverage`; VM runs (the default, and `--function-coverage`) continue to use the existing VM-service collection flow.
- Reject unsupported combinations during argument parsing rather than silently degrading: platforms other than `vm` / `chrome`, `--function-coverage` or `--branch-coverage` combined with a web platform, and platform flags passed through to the test script (`-- -p ...`).
- Normalize `file:` URIs under a package's `lib/` root to `package:` URIs via `Resolver.toPackageUri` and apply `ScopedOutput.includesScript` in `HitMap.parseJsonSync` / `HitMap.parseJson` / `HitMap.parseFiles` so web runs report scoped library coverage matching VM semantics. Warn when no coverage data matches `--scope-output`.
- Pre-flight `package:test` verification in `package_config.json`.
- Fail fast and propagate the test process's exit code when the test process exits before the VM service is ready or before coverage collection finishes.
Towards #24341 parent a66d517 commit 29df634
10 files changed
Lines changed: 850 additions & 90 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
5 | 23 | | |
6 | 24 | | |
7 | 25 | | |
| |||
0 commit comments