Skip to content

Tests for doctest fail #991

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

Open
sol opened this issue Nov 14, 2021 · 5 comments
Open

Tests for doctest fail #991

sol opened this issue Nov 14, 2021 · 5 comments
Labels
component: doc builder re: doctest Concerning doctest suites

Comments

@sol
Copy link
Member

sol commented Nov 14, 2021

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?

@andreasabel andreasabel added the re: doctest Concerning doctest suites label Feb 14, 2022
@andreasabel
Copy link
Member

@sol, the relevant call to cabal is likely here:

void $ cabal opts "v2-test" pkg_flags (Just buildLogHnd)

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

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

@gbaz
Copy link
Contributor

gbaz commented Feb 15, 2022

cf #981 and #961

@gbaz
Copy link
Contributor

gbaz commented Feb 15, 2022

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.

@andreasabel
Copy link
Member

@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.

@brandonchinn178
Copy link
Contributor

@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 (haskell/cabal#7890 (comment)), 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: doc builder re: doctest Concerning doctest suites
Projects
None yet
Development

No branches or pull requests

4 participants