Comments (9)
Hi Steve, thanks for checking in. Can you use LCOV format? coverage.json
is really just an intermediate format that we use, but format_coverage.dart
includes an LCOV formatter.
Also, the minute I get some time to work on it, I intend to add an updated coverage collection tool that spawns another VM process running the test code, collects coverage from it and emits in the requested format in one go rather than via the current two step process. That might simplify things a bit for you.
If you've got any specific feature requests, please let me know!
from coverage.
Thank you for the update! Producing an lcov
file would work. Please correct me if I'm wrong: that lcov does not support branch coverage which is preferable.
If a customer can simply create the lcov file then my uploader will find it. They would only have to call codecov
see example here and the file will be collected and submitted.
If it's not asking to much. I don't know Dart and it would be helpful to have an example repo like these: Codecov Examples. If you can help me create a Dart repo I would be in heaven :)
Thank again for your help.
from coverage.
Sounds good! I've filed #52 for example coverage code. I'll try to get to this next week.
from coverage.
For everyone interested. I just figured out how to send lcov data generated by the coverage
package to codecov from Travis. My very basic .travis.yml
looks something like this:
sudo: false
language: dart
script:
- pub run test
- pub global activate coverage
- dart --observe=8111 test/all.dart &
- sleep 1
- pub global run coverage:collect_coverage --port=8111 -o coverage.json --resume-isolates
- pub global run coverage:format_coverage --package-root=packages --report-on lib --in coverage.json --out lcov.info --lcov
after_success:
- bash <(curl -s https://codecov.io/bash)
The sleep is kind of awkward, but it does the job.
Ideally it would be nice if the coverage package can provide additional executable which would encapsulate observatory stuff and just output the lcov.info
as a result. Can be tricky with dartium though.
from coverage.
@pulyaevskiy would you be available to create a super simple "hello world" example of dart at https://github.com/codecov/example-dart
We can point out caveats like dartium and others that you are aware of. Thanks!
from coverage.
@stevepeak I'd be happy to help. Might be able to push something over the weekend.
from coverage.
@pulyaevskiy I've added you to as a contributors to the project ๐ Thank you so much for helping out.
from coverage.
@stevepeak regarding "Please correct me if I'm wrong: that lcov does not support branch coverage which is preferable.", c - Lcov: can not collect branch coverage statistics - Stack Overflow has some answers suggesting you simply need --rc lcov_branch_coverage=1
.
Looks like coverage would need to modify
coverage/lib/src/formatter.dart
Line 49 in 4d1a38e
Branch coverage information is stored which one line per branch:
BRDA:<line number>,<block number>,<branch number>,<taken>
Block number and branch number are gcc internal IDs for the branch.
Taken is either โ-โ if the basic block containing the branch was never
executed or a number indicating how often that branch was taken.
Branch coverage summaries are stored in two lines:
BRF:<number of branches found>
BRH:<number of branches hit>
from coverage.
@patkujawa-wf Thank you for pointing this out. Codecov does recognize BRDA
data and properly reports branch coverage. ๐
from coverage.
Related Issues (20)
- Speed up --function-coverage
- Filter files using a command line flag HOT 8
- 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 19
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.