Comments (19)
Big +1
from coverage.
+1 from 2019
from coverage.
Update: Function coverage is implemented, and I'm working on branch coverage at the moment.
from coverage.
+1 from 2020
from coverage.
+1 from 2021
from coverage.
Update: I have an implementation of branch coverage sitting in a PR, but branch coverage required some VM work and a new service API, so the PR is blocked on the service API updating to v8.2.0. Eta is a few weeks.
from coverage.
any update for Function coverage?
we already in the end of 2019 :)
from coverage.
It sounds like there's two separate requests here, both involving coarsening the coverage data to make it easier to read. I looked into the feasibility of supporting this in the VM (not for the web).
- Function level. This is easy enough, because the VM service API can already give us code ranges for every function. We can coarsen the coverage data using these ranges. I will start work on this soon.
- Branch/block level. This is much harder. There's no way of getting code ranges for blocks ATM. We could potentially add a new RPC to the API, but this would be quite a lot of work.
How important is the branch/block level info? Would function level info be sufficient for your needs?
My personal feeling is that with line
level on one end and function
level on the other, it would cover a good span.
branch
would certainly be nice to have in the long-run, but the effort to value ratio seems like it would favor getting function
coverage sooner.
from coverage.
bumping priority as it appears to be an issue for customers
from coverage.
I would prefer branch coverage as it gives you way more information/metadata on what is actually covered than line and especially function coverage can give you!
I am really not sure what useful metric function coverage would give you?!
With Branch coverage, you can make informed decisions on how much of your if/else, switch/case, ... statements are covered and make sure that nobody accidentally missed an else statement, as it would be reflected in your coverage report that this else was not covered!
from coverage.
+1 from 2022
from coverage.
+1 from 2022
from coverage.
Would love to see this implemented as well! Looks like still there is no function coverage.
from coverage.
/cc @liamappelbe
from coverage.
It sounds like there's two separate requests here, both involving coarsening the coverage data to make it easier to read. I looked into the feasibility of supporting this in the VM (not for the web).
- Function level. This is easy enough, because the VM service API can already give us code ranges for every function. We can coarsen the coverage data using these ranges. I will start work on this soon.
- Branch/block level. This is much harder. There's no way of getting code ranges for blocks ATM. We could potentially add a new RPC to the API, but this would be quite a lot of work.
How important is the branch/block level info? Would function level info be sufficient for your needs?
from coverage.
To follow up a bit on my comment from last March;
branch would certainly be nice to have in the long-run, but the effort to value ratio seems like it would favor getting function coverage sooner.
My definition of "long-run" has changed a bit since due to the passage of time and more experience with the limitations of line coverage. I 100% agree with @IchordeDionysos :
With Branch coverage, you can make informed decisions on how much of your if/else, switch/case, ... statements are covered and make sure that nobody accidentally missed an else statement, as it would be reflected in your coverage report that this else was not covered!
from coverage.
Is this available in Flutter? I ran flutter test --coverage
, but genhtml still complains about missing function and branch data. I am using flutter 2.8.1
from coverage.
@amarghosh Flutter has their own coverage implementation, so it would need to be implemented there independently. I help out with their coverage implementation, but I'm not on the flutter team, so I don't know if they want the feature or not. File a bug with them, and if they think it's a good idea I'll help add it.
from coverage.
Filed flutter/flutter#108313
from coverage.
Related Issues (20)
- Speed up --function-coverage
- Filter files using a command line flag HOT 6
- Running coverage in new flutter project HOT 1
- --test param throws error when args are added (--test="test --concurrency=1") HOT 1
- incorrect branch and line coverage with const values HOT 1
- Add `--fail-under` option
- LCOV relative paths HOT 1
- No Coverage Generated
- Fix BRDA syntax in lcov files HOT 3
- Enable firehose for publishing from GitHub actions
- Clean up old SDK/VmService checks
- Tests with `Isolate.run` pause indefinitely. HOT 6
- Ignore like `// coverage:ignore-start` does not work HOT 1
- bug: `format_coverage` does now work when invoked with `dart pub global run`
- cover code for kIsWeb condition true and false both cases
- Test coverage doesn't work when using pattern matching to destructure a record HOT 1
- How to run coverage for multiple packages in a mono_repo HOT 1
- Coverage not reported correctly for too many line hits HOT 1
- test_with_coverage won't exit on flutter 3.22.0
- test_with_coverage not exiting on Windows Github actions with Dart 3.4.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coverage.