Giter Club home page Giter Club logo

Comments (6)

mboes avatar mboes commented on July 26, 2024

@SebastianKG can we close? Reassigning to you in the meantime.

from rules_haskell.

SebastianKG avatar SebastianKG commented on July 26, 2024

I'll write up some documentation, then close. We have the functionality, but no one knows how to use it except me.

from rules_haskell.

ghorn avatar ghorn commented on July 26, 2024

The documentation leaves a few questions for me. When the coverage is enable by specifying expected_expression_coverage, what are the differences between this and no coverage except for the report and possibly test failure? Does it compile in a different mode? Are there performance considerations? Could latent bugs be triggered?

How does one generate a coverage report, or is it not yet possible?

This probably doesn't belong here but I'm not sure % coverage as an integer is a sufficient metric to prevent regressions. If you have 100 tests and someone adds one it probably won't change the number. A better metric could be number of uncovered "things" like expressions, if conditions, etc. Is there a mechanism for making people update the number when they improve it? Maybe if the actual coverage is not exactly equal to the number it would be better than if the actual coverage was less than the number for a failure condition.

from rules_haskell.

SebastianKG avatar SebastianKG commented on July 26, 2024

@ghorn great questions, thanks for reviewing this work.

When the coverage is enable by specifying expected_expression_coverage, what are the differences between this and no coverage except for the report and possibly test failure? Does it compile in a different mode? Are there performance considerations? Could latent bugs be triggered?

I didn't want to get too technical in the documentation, but it would be good to cover the basics of what the user should expect. Since there are additional steps during compilation, and since the resulting files are instrumented to generate coverage checklists at runtime, the user should expect both slightly slower compilation and slightly slower execution. This only occurs when running bazel coverage, and hasn't changed the performance of run/build/test. I'll add this information to the doc.

How does one generate a coverage report, or is it not yet possible?

Not possible yet, but definitely would be awesome. It isn't really possible to output a file from a run of bazel coverage (nor from bazel test), so I would have to find another makeshift solution for getting the user that coverage report. hpc does support html output, so that part of the process would be easy.

This probably doesn't belong here but I'm not sure % coverage as an integer is a sufficient metric to prevent regressions. If you have 100 tests and someone adds one it probably won't change the number. A better metric could be number of uncovered "things" like expressions, if conditions, etc. Is there a mechanism for making people update the number when they improve it? Maybe if the actual coverage is not exactly equal to the number it would be better than if the actual coverage was less than the number for a failure condition.

This is really interesting feedback. I've always seen coverage used as a percentage, but I see some advantages to a raw count of uncovered expressions. As you said, I think this is a problem for a different issue, but I'll keep it in mind.

from rules_haskell.

SebastianKG avatar SebastianKG commented on July 26, 2024

Myy PR got merged while I was writing all that. 😅 will still add information about coverage performance in a secondary PR. Closing this issue though, now that there is some documentation out there.

from rules_haskell.

SebastianKG avatar SebastianKG commented on July 26, 2024

@Fuuzetsu check out the new documentation for information on how to use the new functionality https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#checking-code-coverage

from rules_haskell.

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.