hackage-server icon indicating copy to clipboard operation
hackage-server copied to clipboard

Tests for `doctest` fail

Open sol opened this issue 4 years ago • 5 comments

https://hackage.haskell.org/package/doctest-0.20.0/reports/

Don't see a build log for the actual test failure, nor do I know how exactly hackage tries to run the tests. What I assume could be the issue is this: doctest's test suite needs to be run with cabal exec, specifically, this is how I run the tests:

cabal configure --enable-tests && cabal build && cabal exec -- cabal test --test-show-details=direct

Can this please be fixed? Alternatively, if this can not be fixed in a timely manner, can I please get rid of the Tests Failed-badge?

sol avatar Nov 14 '21 08:11 sol

@sol, the relevant call to cabal is likely here: https://github.com/haskell/hackage-server/blob/507e8e557e78d0ff33811f5148ab3254c2390d80/exes/BuildClient.hs#L643

Unfortunately, no test log is made available. This would definitively be an improvement.

Would prefixing cabal test with cabal exec work for all packages?

andreasabel avatar Feb 15 '22 06:02 andreasabel

cf https://github.com/haskell/hackage-server/issues/981 and https://github.com/haskell/hackage-server/issues/961

gbaz avatar Feb 15 '22 17:02 gbaz

I don't think we want to support running tests in any other way than standard v2-test. But we should allow test opt-out and also definitely have ux to display test results.

gbaz avatar Feb 15 '22 17:02 gbaz

@sol: An unexpected way to prevent tests being run on Hackage is to upload the documentation yourself (see #1037). I use this script

cabal haddock --haddock-for-hackage | tail -1 | xargs cabal upload -d "$@"

where $@ usually either contains --publish or not.

andreasabel avatar Mar 25 '22 07:03 andreasabel

@gbaz I understand not wanting to support anything other than v2-test. What about explicitly setting GHC_ENVIRONMENT and/or GHC_PACKAGE_PATH when Hackage runs tests? It seems like this will never be added to plain v2-test (https://github.com/haskell/cabal/issues/7890#issuecomment-1003719028), but it seems like a lot of the desire for cabal exec -- cabal v2-test would be satisfied if these env vars were specifically set

brandonchinn178 avatar Nov 06 '22 04:11 brandonchinn178