Skip to content

Support coverage from "dart test" in lcov format to match "flutter test", and make the output locations more consistentΒ #60958

Open
@DanTup

Description

@DanTup

VS Code has APIs for providing code coverage during test runs (which will then be shown in the editor). I've a long-standing request to implement this in Dart-Code (Dart-Code/Dart-Code#2860).

I started looking at this today but found that dart test --coverage and flutter test --coverage are very different. Flutter takes a single filename (--coverage-path) and produces data in the lcov format, but Dart (or pkg:test?) outputs a JSON format (which I'm not sure about - maybe is VM-specific?).

The docs for pkg:test say that the coverage can be converted with pkg:coverage, but for Dart-Code this makes things much more complicated (I try to avoid just pub global activateing things on a users machine, and it adds another level of potential versioning that is different to the SDK).

It would be really nice if we could pass similar flags to dart test and flutter test that results in them producing the same format of output, in the same kind of location (eg. we can provide a filename or a folder to each).

Metadata

Metadata

Assignees

Labels

area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.dart-cli-testIssues related to the 'dart test' tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions