Open gesellc opened 7 years ago
Coverage measures what part of the code was actually executed. If it's not executed it's not measured as executed. To me it's entirely unclear what this request is about.
Is there a way to measure coverage for the group of all existing dart files in a repository tree or a subfolder?
What exactly is this supposed to measure? Measure the code that would be executed if it would be executed?
For example: When a commit adds a dart file to our project without any unit test executing that file I would like to see a decrease in the code coverage report on coveralls.io.
For that to happen I assume that the coveralls upload must also include all the source files that we are interested in, but that are not covered yet.
Just integrate coverage with CI so that it's run on every commit.
Just to reply to your last post: We have integrated coverage in CI and since then it runs on every commit. Links are in the first post of this issue.
I'll use coverage.py to try to explain this from another angle. In this section the coverage.py documentation describes the feature we are looking for:
You can specify source to measure with the --source command-line switch, or the [run] source configuration value. The value is a comma- or newline-separated list of directories or package names. If specified, only source inside these directories or packages will be measured.
This is the important part:
Specifying the source option also enables coverage.py to report on unexecuted files, since it can search the source tree for files that haven’t been measured at all.
That's it, I would like coveralls.io to show unexecuted files that are part of our dart package. I want to see those files with 0% coverage so that we can observe where we stand and how we progress while writing more unit tests.
Can we do this with dart_coveralls?
@gesellc I think that makes it clear what the issue is about.
@zoechi @gesellc thanks for the clarification loop. This seems not covered by the VM, so the implementation would be something like this:
I'm unsure though if this is to be considered 'core functionality'. You could achieve the same by:
Do you think you could start with the 2nd approach and see how it works? Once it does, I would happily include it into dart_coveralls.
We run dart_coveralls via travis.ci.
Now dart_coveralls seems to upload only coverage information for the files that are run during unit testing. Meaning all dart files that are not yet checked by unit tests (0% coverage) are ignored during code coverage calculation.
As a result the coverage percentage is too high not taking into account all the non-covered dart files.
Is there a way to measure coverage for the group of all existing dart files in a repository tree or a subfolder?