Comments (6)
@SebastianKG can we close? Reassigning to you in the meantime.
from rules_haskell.
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.
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.
@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.
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.
@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)
- Refactor `rules_haskell` CI workflow.
- Fix out-of-memory errors in CI when running `run-tests` in `rules_haskell_tests`. HOT 4
- Fix CI failures related to `Test GHC Patches` HOT 1
- Remove old GHC versions
- rts dependency in cc_library no longer works (can't find HsFFI.h) HOT 5
- Refactor Bazel configuration to reduce/eliminate platform-specific flags HOT 3
- `ghc_wrapper` is killed on MacOS arm64 running tests under `rules_haskell_tests` HOT 6
- Prepare release 0.19
- Update BCR presubmit to use `rules_haskell` instead of running the tests in `rules_haskell`
- Upgrade to new rules_nixpkgs release
- Buildifier support on NixOS with bzlmod HOT 1
- Haddock 2.30 faillure in profiling mode
- proto-len protoc plugin failures on windows with ghc 9.6.2 and 9.8.1
- Docker example should work on Darwin
- Dependency Dashboard
- Bazel 7.1.1 and nixpkgs GHC 9.8.2 produce dynamically linked haskell_cabal_binary's
- Avoid creating empty libraries
- [Bazel CI] Unrecognized option incompatible_struct_has_no_methods in bazel command HOT 3
- build on Bazel CI broken HOT 2
- [Bazel CI] library tests are failing with Bazel@HEAD HOT 8
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 rules_haskell.