-
Notifications
You must be signed in to change notification settings - Fork 848
stack test --coverage stopped working #1305
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
Comments
Hmm, interesting! Looks like what's happening is that the library isn't getting rebuilt, despite reconfiguring with In other words, if you instead do:
So, I think this is a ghc or cabal bug.. I've tried to search for an issue in the cabal tracker about it, but haven't found one. I guess the steps are:
|
Thanks, it works! But I don't think the solution is ideal. This doubles my compilation time, is it strictly necessary? |
Oh, agreed, that isn't my suggested solution. Everything should be fine if you run Another solution is to always pass I'm leaving this open, though, as it'd be really unfortunate to foist that on people. This could also be a regression, perhaps a difference in how |
If I run
This is why I was running |
Ah, interesting. I actually fixed that in this PR, which I've just merged. And here I thought it was introduced by the changes in that PR! So, updating to the very latest development version should fix that. |
I built stack at commit ebd9d1b. Now it always produces reports, but they are for the test suite only. To reproduce$ git clone https://github.com/rubik/argon && cd argon
$ stack test :argon-test --coverage |
What do mean by the reports only being for the test suite? I get the results I'd expect, which is coverage info for the library code, based on its usage by the test-suite. |
I'm sorry, disregard everything I said. It was an error on my part and it absolutely works as expected. EDIT: I was wondering, does your PR lift the restriction that the library code shouldn't be built with the test suite? For example, I would like to test some non-public API, but since the test suite must depend on the library to obtain meaningful coverage (issue #1008) I'm forced to make it public. |
Cool! My PR doesn't didn't affect coverage stuff much. I've opened this issue to track coverage for non-library modules: #1359 |
Searched for similar issues. Found: commercialhaskell/stack#1305 Followed instructions to invoke `stack clean` command and pass `--coverage` flag to both `stack build` and `stack test` commands. Updated `README.md` file. Closes pacifica#2
* [MSCOPS-5] fix(ci): generate coverage report Searched for similar issues. Found: commercialhaskell/stack#1305 Followed instructions to invoke `stack clean` command and pass `--coverage` flag to both `stack build` and `stack test` commands. Updated `README.md` file. Closes #2 * Ignore tix files Tix files are created when a coverage report is generated, e.g., the command `stack test --coverage` generates the file `robinhood-test.tix`.
When running tests no code is analyzed, but previously it was working:
The warning does not apply, because tests do not build the library, instead depend on it. Relevant section of my Cabal file:
I'm using Stack from the master branch.
The text was updated successfully, but these errors were encountered: