haskell / haskell/haskell-language-server

Fix some tests by using `runSessionWithServerInTmpDir` instead of `runSessionWithConfig`

Open
#5,054 0 comments 0 reactions 1 assignee Claimed by @Aster89 View on GitHub
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
4d 3h
Merged PRs (30d)
12

Description

@fendor noticed that https://github.com/haskell/haskell-language-server/pull/5020 fails because fourmolu tries to read the `haskell-language-server.cabal` during the test. It shouldn't, that's probably some implicit `fourmolu`/`ormolu` behaviour looking for a `.cabal` file.

If we run the tests in temporary directories, then we might be able to merge that PR after all. (Not really, because of Debian, see https://github.com/haskell/haskell-language-server/pull/5020#issuecomment-5426849998.)

Instead of `runSessionWithConfig`, we should be using our test runners that copy the directory into a temporary directory, e.g. `goldenWithHaskellDocInTmpDir` or `goldenWithHaskellDocFormatterInTmpDir`

Probably rather `runSessionWithServerInTmpDir` since the tests modify the configuration during the tests.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.