Skip to content

Support excluding some folders/paths from coverage #5630

@DanTup

Description

@DanTup

This was requested on Discord by @RedPhœnix:

I’d like to exclude certain folders from the coverage results (for example, my lib/l10n/generated folder), but I haven’t found a way to do that yet. Is this currently possible, or is there a workaround someone could recommend?

I think there are a few ways this could be supported:

  1. Natively by VS Code, which just drops the coverage and computes totals excluding it
  2. By Dart-Code, which also just drops the coverage before reporting to VS Code
  3. By dart test / flutter test where it doesn't collect the coverage in the first place

@liamappelbe what are your thoughts on (3)? It would be nicer (and perhaps faster) if we this coverage wasn't collected for these files in the first place, but it might be that the difference is negligible and we should just drop it in Dart-Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in coverageRelates to collecting code coverage when running Dart/Flutter testsin testingRelates to test execution of Dart/Flutter tests for end usersis enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions