Open komikat opened 3 weeks ago
It seems hls-refactor-plugin-tests
depend on the cache directory.🤔
/tmp/hls-test-root/.cache-b4d2c0447616dd51: createDirectory: does not exist (No such file or directory)
That seems impossible to me, there must be another race condition :D
Weird because hls-refactor-plugin-tests
seems to pass on my system (MacOS, ghc9.8)
The setup wasn't creating the hls-test-root
directory.
ghcide-tests
is still failing, will look into this soon.
$TEMPDIR/hls-test-root
running HLS_TEST_HARNESS_NO_TESTDIR_CLEANUP=1 HLS_TEST_LOG_STDERR=1 TASTY_PATTERN="/definition.Imported symbol (reexported)/" cabal test ghcide-tests
FAILS (>=GHC94)
expected: Location {_uri = Uri {getUri = "$TMPDIR/hls-test-root/extra-dir-85406152527/Bar.hs"}, _range = Range {_start = Position {_line = 3, _character = 5}, _end = Position {_line = 3, _character = 8}}}
but got: Location {_uri = Uri {getUri = "$TMPDIR/hls-test-root/extra-dir-85406152527/Bar.hs"}, _range = Range {_start = Position {_line = 3, _character = 0}, _end = Position {_line = 3, _character = 14}}}
itExists <- liftIO $ doesFileExist fs
returns truesrcSpanToLocation sp
rng <- srcSpanToRange src
reports a different location from what's expected in the testsp
comes from
nameSrcSpan name
in that branch.This is good!
Let's merge this as is, add the comment to the test case, create an issue containing the knowledge you have gained so far, and then accept the test case changes. E.g., update the assertions in the test. Even though we have discovered an interesting race (?) condition, the test case itself will be stable.
@komikat Could you do that, please?
Fixes #4200 by creating a separate temporary
.cache
directory for every test instead of having all tests share the same.cache
directory. This makes sure the testiface-error-test-1
is run with a clean directory — causing the diagnostic to be generated every time.