Update documentation for running tests #3844
Labels
documentation
level: easy
The issue is suited for beginners
type: enhancement
New feature or request
Is your enhancement request related to a problem? Please describe.
The contributing guide mentions this alternative:
cabal run haskell-language-server:func-test -- -p "hlint enables"
This is supposed to work around Cabal flushing caches when using
--test-options
:But that does not work, because Cabal does not set executables to PATH for
run
:cabal test
sees the executable, butcabal run
does not. cabal#8391And thus
runSession
produces this slightly confusing message:Describe the solution you'd like
The contributing guide should probably be updated to mention this error and link to the Cabal bug.
As a temporary workaround, the tests could check that the executable exists and print more helpful error.
Describe alternatives you've considered
The users can set
HLS_TEST_EXE
andHLS_WRAPPER_TEST_EXE
like CI does, but that seems brittle.haskell-language-server/test/utils/Test/Hls/Command.hs
Lines 10 to 19 in c0f7d4c
Additional context
I hit this long ago and @pepeiborra helpfully pointed out that this does not work in #2837, but I have since forgotten about it. 😅
The text was updated successfully, but these errors were encountered: