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

Detect when hpc report (--coverage) is giving a trivial "100%" #1009

Closed
mgsloan opened this issue Sep 18, 2015 · 2 comments
Closed

Detect when hpc report (--coverage) is giving a trivial "100%" #1009

mgsloan opened this issue Sep 18, 2015 · 2 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Sometimes when things don't go right with coverage, it yields a report with lots of (0/0):

Generating HTML coverage report for cereal-conduit's test-suite "test-cereal-conduit"
100% expressions used (0/0)
100% boolean coverage (0/0)
     100% guards (0/0)
     100% 'if' conditions (0/0)
     100% qualifiers (0/0)
100% alternatives used (0/0)
100% local declarations used (0/0)
100% top-level declarations used (0/0)

This happens due to the way cereal-conduit's cabal file is written (see #1008)

Skimming by, this might look like a stellar coverage report - all 100%s! However, it isn't really checking anything. (0/0) means that no top level definitions were included in the report. Unfortunately, the hpc program tends to carry on with yielding a report instead of throwing errors in various circumstances. We should let the user know that this circumstance might indicate a stack bug, and perhaps link them to this issue.

@mgsloan
Copy link
Contributor Author

mgsloan commented Sep 18, 2015

Note: since we aren't going to add a warning for #1008, the message for this should mention that it's a possible cause. I'm imagining a message like this:

Error: The coverage report for cereal-conduit's test-suite "test-cereal-conduit" did not consider any code. One possible cause of this is if your test-suite builds the library code (see stack issue #1008). It may also indicate a bug in stack or the hpc program. Please report this issue if you think your coverage report should have meaningful results.

@mgsloan
Copy link
Contributor Author

mgsloan commented Oct 9, 2015

Done!

@mgsloan mgsloan closed this as completed Oct 9, 2015
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
Projects
None yet
Development

No branches or pull requests

1 participant