fix: report all coverage when no filters are specified#2594
fix: report all coverage when no filters are specified#2594natebosch merged 4 commits intodart-lang:masterfrom
Conversation
I didn’t see any tests in pkg:test_core but happy to write some. Let me know how you want me to proceed. |
|
it's a workspace / monorepo – guessing the tests would be in |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
Okay I’ll take a look tomorrow 👍 |
EXACTLY! 😉 |
Added tests and updated the changelog ✅ |
|
@natebosch is (likely?) the right person to review here... |
|
If the goal is to change the default behaviour to include coverage for all packages, including transitive deps, then this approach works. But for most users that's going to mean that the default behaviour includes a lot of coverage data that they don't care about. It also means package:coverage is going to waste time gathering all that coverage. We do need to support the use case in #2581 somehow, but it's an obscure use case. So I think it would be reasonable to ask those users to change the flags they pass, if this makes the common use case simpler. Before we make a UX decision like that though, I have a few questions:
I think if either of those flags work, then we don't need to change anything in package:test. I suspect they won't work though. I think So I think the best option would be to make Ofc, if @natebosch says maintaining backwards compatibility is more important, then this PR LGTM. |
@liamappelbe yup this reverts to the previous behavior and the specific goal was to restore coverage reporting for Dart Frog which includes code in a top level routes directory (see the newly added test case). This used to be reported by default and I don’t think either of those command line options work unfortunately so coverage data that we were previously relying is no longer accessible without a change to pkg:test :( |
Yeah, I didn't think they would work immediately. What I'm suggesting is that you modify this PR to make one of those options work. That we can keep the default behaviour fulfilling the use case of most users. |
I just tested on my minimal repro sample, and neither |
|
@liamappelbe @natebosch let me know how you want me to proceed. I personally wouldn’t change the default behavior in a breaking way unless there are really good reasons to do that. fwiw I’ve been collecting coverage in dart for many years in fairly large projects and the speed of this particular step has never been an issue 🤷 I would highly recommend reverting to the previous behavior and if we want to make this change it should be made in a new major version imo (2.0.0) |
|
The excess coverage is mainly an issue in the new LCOV workflow. If you're using the old JSON workflow, then you are likely applying filters in the If maintaining backwards compatibility is very important, maybe we can go with the other option I mentioned, where the default behaviour in LCOV mode remains the same (only reporting coverage on the package under test), but we revert the behaviour for JSON mode (back to not filtering anything). @natebosch can decide. |
This sounds like a good choice to me. We can figure out a way to migrate away from the old JSON behavior later and for now use the nicer behavior only in LCOV mode. |
Sounds good I’ll update this PR shortly 👍 |
3184be4 to
bb2047c
Compare
|
@kevmoo @liamappelbe @natebosch can you please take a look? I attempted to refactor the PR to only affect the old JSON workflow. Let me know if I missed anything, thanks! |
|
@natebosch @kevmoo is there an ETA for when this will be published? |
|
@felangel – good question for Monday morning 😉 |
|
We need to get this package rolled through to the SDK and internally to google3 before we can publish and we hit a snag with a breaking change in one repo. https://dart-review.googlesource.com/c/sdk/+/482520 Should be able to publish in the next few days. |
--coverage-pathand--branch-coverageoptions #2517