You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
coverage 1.16.0: format_coverage fails on the {} that dart test --coverage writes for fully skipped suites #2667
When every test in a suite is skipped (for example, excluded by tag in dart_test.yaml), dart test --coverage=coverage writes coverage/<path>.vm.json containing {}. Since 1.16.0, HitMap.parseFiles throws on that file, so format_coverage --in=coverage fails after a passing test run:
FormatException: Unrecognized coverage JSON in "coverage/test/ensure_build_test.dart.vm.json". Expected a {"coverage": [...]} report, but got _Map<String, dynamic>.
#0 HitMap.parseFiles (package:coverage/src/hitmap.dart:190:11)
#1 main (.../coverage-1.16.0/bin/format_coverage.dart:74:18)
Repro:
A package with one test file tagged @Tags(['skipme']) and tags: {skipme: {skip: true}} in dart_test.yaml.
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
This works with 1.15.1. Either format_coverage could treat {} as an empty report, or dart test could skip writing the file for suites that collected nothing.
Activity
fix(coverage): allow empty coverage files from skipped test suites (#…