You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hpc program supports merging two tix files. This means that we can combine together the results of different test runs into a single coverage report.
Lets say package A uses package B, and package B's test suite doesn't have full coverage of its code. If package A's test suite ends up exercising these code paths in B, then this will show up in its individual coverage report. However, we won't see this coverage in B's report (and we wouldn't want to). If we can generate a unified coverage report for the whole stack project, then we can see this coverage without looking at all the individual reports.
When you have a lot of interdependent packages with test suites, this saves a bunch of laborious cross-checking of coverage reports.
Unfortunately, hpc merge does not work ideally for the use case of merging results from different binaries. In particular, I get hpc: mistmatched in module Main. Apparently .tix and .mix files do not disambiguate between modules when they're built into executables rather than libraries (which do get disambiguated). This causes other issues, such as described here.
All is not lost. What this means is that we need to exclude the modules which are built into the test binaries. For my test case, adding --exclude=Main does the trick. One hacky approach would be to parse out the error message from the hpc program and add exclude= flags as needed :)
The text was updated successfully, but these errors were encountered:
mgsloan
changed the title
Consider providing a unified report for test coverage
Consider providing a unified report for "test --coverage"
Jul 14, 2015
* master: (59 commits)
Ignore global database when copying precompiled packages #1146
Revert an unneeded change to 'runAndLog'
Remove old GHCJS unpack directory if it exists
Allow "stack setup ghcjs-0.1.0.20150924_ghc-7.10.2"
Properly unzip GHCJS on windows (stack setup)
Consider user-specified package flags in stack solver #1071
Fix a warning
Colored build status in filewatch mode
Add NixOS to 'How to install'.
Include NixOS information #1118
Style improvements for Docker compatibility check
Fix `awaiting pr` label link
Fix GHC 7.8 build
Docker: check host's stack compatibility by attempting to run in container and caching the result (#974)
Fix formatting in `explicit-setup-deps` section
Provide more information about changed files
Compile custom Setup.hs instead of interpreting them (fixes#1041)
Detect when hpc report gives trivial 100% #1009
Unified coverage report #579
Recommend extra-dep in yaml_configuration.yml
...
The
hpc
program supports merging two tix files. This means that we can combine together the results of different test runs into a single coverage report.Lets say package A uses package B, and package B's test suite doesn't have full coverage of its code. If package A's test suite ends up exercising these code paths in B, then this will show up in its individual coverage report. However, we won't see this coverage in B's report (and we wouldn't want to). If we can generate a unified coverage report for the whole stack project, then we can see this coverage without looking at all the individual reports.
When you have a lot of interdependent packages with test suites, this saves a bunch of laborious cross-checking of coverage reports.
Unfortunately,
hpc merge
does not work ideally for the use case of merging results from different binaries. In particular, I gethpc: mistmatched in module Main
. Apparently .tix and .mix files do not disambiguate between modules when they're built into executables rather than libraries (which do get disambiguated). This causes other issues, such as described here.All is not lost. What this means is that we need to exclude the modules which are built into the test binaries. For my test case, adding
--exclude=Main
does the trick. One hacky approach would be to parse out the error message from thehpc
program and addexclude=
flags as needed :)The text was updated successfully, but these errors were encountered: