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

Coverage report not picking any tests with ghc-7.10 resolver #785

Closed
jdnavarro opened this issue Aug 14, 2015 · 15 comments
Closed

Coverage report not picking any tests with ghc-7.10 resolver #785

jdnavarro opened this issue Aug 14, 2015 · 15 comments
Assignees
Milestone

Comments

@jdnavarro
Copy link
Contributor

The tests run properly, but none are shown in the coverage report. This only happens with the ghc-7.10 resolver. The coverage is coming fine when using lts-2.22 resolver or when using a cabal-install sandbox with ghc-7.10.1.

I can provide more detailed information to reproduce the bug, but wanted to confirm this doesn't sound like a known problem.

@mgsloan mgsloan self-assigned this Aug 14, 2015
@jdnavarro jdnavarro changed the title Coverage report not picking any tests ghc-7.10 resolver Coverage report not picking any tests with ghc-7.10 resolver Aug 15, 2015
@borsboom borsboom added this to the 0.2.0.0 milestone Aug 17, 2015
@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Hi! Sorry for not getting back to this sooner. That doesn't sound like a known problem to me. Do you still have the details about how to reproduce the bug?

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Also, this might be relevant: #1009

@jdnavarro
Copy link
Contributor Author

Yes, it's exactly the same error as in #1009. Here it's a way to reproduce it:

$ git clone https://github.com/plutonbrb/nero
$ cd nero
$ stack --stack-yaml=stack-7.8.yaml test --coverage nero:tasty

That works as expected.

But the following gives 100% coverage with 0 tests run:

$ stack --stack-yaml=stack-7.10.yaml test --coverage nero:tasty

My stack binary is coming from Arch Linux AUR, this is what stack --version prints:

Version 0.1.4.0, Git revision 165db5bd77cc88745e0ec8e143275575e5a75d93 (1723 commits) X86_64

I was about to try with HEAD but I'm getting some libtinfo missing dependency issue after the recent Arch Linux GHC upgrade. I'll let you know when I get around fixing it.

@jdnavarro
Copy link
Contributor Author

I can confirm this also happens with stack-HEAD as of 4e58783.

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Thanks for the repro, it works for me. Very strange!

@jdnavarro
Copy link
Contributor Author

@mgsloan what OS are you on? 😕

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Ubuntu. The repro does work. The very strange thing is the bug.

The verbose logs don't show the two builds doing anything very different, and both of the runs generate .tix files. Looking into it

@jdnavarro
Copy link
Contributor Author

If I remember correctly with cabal-install the coverage was working with 7.10. Maybe looking into what changed in cabal-install regarding hpc may help.

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2015

Ah, looks like the problem has something to do with the hashed package identifier stuff, I'm ending up with folders like nero_9bTCpMF7G4UFWJJvtDrIdB in the hpc directory, whereas on 7.8 I'd get nero-0.3.1

@jdnavarro
Copy link
Contributor Author

Is this related? ttuegel/cabal@1bda428 and haskell/cabal#2457

@mgsloan
Copy link
Contributor

mgsloan commented Sep 19, 2015

Yup, that's related! The fix was more involved than I'd hoped (parsing ghc-pkg describe results for the package key), but it works!

Please close the issue if it works for you. Thanks for reporting it!

@jdnavarro
Copy link
Contributor Author

Works now for me. Thank you!

@mgsloan
Copy link
Contributor

mgsloan commented Oct 15, 2015

@jdnavarro Turns out my implementation approach was flawed. Asking ghc-pkg for the package key only works if the package version you're testing is the exact one that's installed.. I've just pushed a commit that instead parses the key out of package.conf.inplace.

mgsloan added a commit that referenced this issue Oct 15, 2015
@jdnavarro
Copy link
Contributor Author

I didn't notice the flaw, but may have created some confusion in the future. Thanks for fixing it.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 15, 2015

Welcome! I'm actually back on the case, as the fix caused issues: #1162

mgsloan added a commit that referenced this issue Oct 19, 2015
This brings back e26dc62, but with
better error reporting (not fatal, and put in the output HTML), and
gracefully handles the case that the cabal file does not have a library
stanza (#1162)
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

3 participants