Coder Social home page Coder Social logo

Comments (9)

cbracken avatar cbracken commented on May 29, 2024

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.

stevepeak avatar stevepeak commented on May 29, 2024

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.

cbracken avatar cbracken commented on May 29, 2024

Sounds good! I've filed #52 for example coverage code. I'll try to get to this next week.

from coverage.

pulyaevskiy avatar pulyaevskiy commented on May 29, 2024

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.

stevepeak avatar stevepeak commented on May 29, 2024

@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.

pulyaevskiy avatar pulyaevskiy commented on May 29, 2024

@stevepeak I'd be happy to help. Might be able to push something over the weekend.

from coverage.

stevepeak avatar stevepeak commented on May 29, 2024

@pulyaevskiy I've added you to as a contributors to the project ๐Ÿ‘ Thank you so much for helping out.

from coverage.

patkujawa-wf avatar patkujawa-wf commented on May 29, 2024

@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

buf.write('SF:${source}\n');
to write that info as defined at Linux Test Project - Coverage ยป lcov:

   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.

stevepeak avatar stevepeak commented on May 29, 2024

@patkujawa-wf Thank you for pointing this out. Codecov does recognize BRDA data and properly reports branch coverage. ๐Ÿ‘

from coverage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.