brandonchinn178 / hpc-lcov

Convert HPC coverage output to LCOV format
http://hackage.haskell.org/package/hpc-lcov
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Data.HashMap.Base.(!): key not found #13

Closed pbrisbin closed 4 years ago

pbrisbin commented 4 years ago

Describe the bug

See Title.

Steps to Reproduce

Over in my bugsnag-haskell project,

% stack build --coverage --flag bugsnag-haskell:examples --fast --pedantic --test
{ passing test output elided }

bugsnag-haskell> Test suite spec passed
{ successful generation output ellided }

The unified report is available at /home/patrick/code/pbrisbin/bugsnag-haskell/.stack-work/install/x86_64-linux/02d47e96fd017a924798f196a44899a9f0f32f4a8b3e611697067747477e1c2c/8.6.5/hpc/combined/all/hpc_index.html

An index of the generated HTML coverage reports is available at /home/patrick/code/pbrisbin/bugsnag-haskell/.stack-work/install/x86_64-linux/02d47e96fd017a924798f196a44899a9f0f32f4a8b3e611697067747477e1c2c/8.6.5/hpc/index.html
% stack exec hpc-lcov
hpc-lcov: Data.HashMap.Base.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Base.hs:631:16 in unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4:Data.HashMap.Base

I know the coverage data is good, because the HTML appears valid:

Expected behavior

It should not panic. It should report a meaningful error (if this is operator error) or generate an lcov.info successfully (if not).

Environment

Sidenote

Nice package! I considered this approach (using lcov as intermediate) when I wrote cc-coverage. I forget why I decided not to :thinking:. Anyway, super excited to stop maintaining that package and use this instead!

brandon-leapyear commented 4 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


Hi @pbrisbin! So sorry for not getting to this sooner. For some reason, I didn't get any notifications when you submitted this issue.

Is this still an issue for you? The only instance I'm seeing of ! is here: https://github.com/LeapYear/hpc-lcov/blob/master/exe/Main.hs#L172. Does your stack.yaml file not have any packages key?

brandon-leapyear commented 4 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


Oh I see. TIL that packages is optional and defaults to

packages:
- .

I'll go ahead and make a fix

pbrisbin commented 4 years ago

Thanks for the quick (once you heard about it anyway) fix!