Skip to content

Example files should not be counted in test coverage requirements #459

Open

Description

@jonasfj

Here I am getting a false positive because I'm adding examples: dart-lang/core#999

Image

IMO, test coverage should only be counted for files in `lib/´.

When it comes to example/ subfolder, I agree that it would be nice to test examples. But really it's probably acceptable that they are covered by dart analyze.

Otherwise, we have to come up with a reasonable way to test them. Either, by saying you always make example/<examplepkg1>/bin/myexample.dart because then you can put tests for examples in to example/<examplepkg1>/test/ but probably the test setup we have in firehose and codecoverage doesn't do that. And for cases where we just want a single simple test file, it's total overkill to make a subfolder in example with pubspec and everything.

For now maybe the best approach is to not count files in example/ when collecting code coverage.

Same with files in tool/, etc.. probably we should only consider files in lib/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions