Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider providing a unified report for "test --coverage" #579

Closed
mgsloan opened this issue Jul 14, 2015 · 1 comment
Closed

Consider providing a unified report for "test --coverage" #579

mgsloan opened this issue Jul 14, 2015 · 1 comment
Assignees
Milestone

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Jul 14, 2015

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 :)

@mgsloan mgsloan changed the title Consider providing a unified report for test coverage Consider providing a unified report for "test --coverage" Jul 14, 2015
@snoyberg snoyberg added this to the 0.3.0.0 milestone Jul 14, 2015
@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 9, 2015

Done!

@mgsloan mgsloan closed this as completed Oct 9, 2015
mgsloan added a commit that referenced this issue Oct 9, 2015
+ put tix files in report dir
dysinger added a commit that referenced this issue Nov 13, 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants