-
Notifications
You must be signed in to change notification settings - Fork 843
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
stack test --coverage
fails sporadically
#1181
Comments
I, on the other hand, always get the error. For one reason or another, |
This is due to HPC using package keys in the tix / mix files, along with a bug in Cabal which causes package keys to vary: haskell/cabal#2870 . The package key is needed in order to filter the report results down to just the library modules (see #634). Unfortunately, the use of package keys rather than IPIDs makes it difficult to munge the tix files to get around this issue. @rubik Do your test-suites also build the library code (shares hs-source-dirs with the library)? .tix files should be present in the subdirs of A potential workaround for the Cabal issue is to build all the package components together, but this won't be possible when your test-suite depends on some package which depends on the library (cyclic dependency): #1166 Considering that it is reasonably common for packages to define test-suites in this way, and this feature is causing problems, I'm thinking it ought to be turned on with a flag. Perhaps |
@mgsloan Thanks, I somehow thought that the
I don't understand what I'm doing wrong. Here is my cabal file: |
Yeah, hpc's error reporting isn't so good (see my ghc trac issue on the subject: http://ghc.haskell.org/trac/ghc/ticket/10951 ). Either you have old hpc files there which have a hash mismatch, or the folder isn't there at all. The mix files are in
You can see the invocation stack uses by using |
Thank you for the quick reply. Unfortunately it still does not work. I tried everything from explicitly adding the |
If I run
stack test --coverage
on a freshly cloned repo (algebra-elementary, in my case), I getBut, when I run
stack build; stack clean; stack test --coverage
, I getNow, the above is on my laptop, but doing the same
stack build; stack clean; stack test --coverage
on Travis-CI results inI'm not sure if this is a stack bug, or if my cabal file is messed up. If it's the latter, it may be a good idea to describe the correct cabal configuration in the stack guide, perhaps with a barebones example. I've fiddled with the cabal file quite a bit and haven't figured out how to consistently produce reports (#1008 hasn't really enlightened me).
The text was updated successfully, but these errors were encountered: