Repository navigation
runSessionWithConfig -> runSessionWithServerInTmpDir in test/functional/Format.hs - #5154
Conversation
69183c6 to
ae02dca
Compare
|
I've duplicated the first part of the However, to include the following parts of the test, where ormolu is run on the file as edited by fourmolu, I'd need @fendor, what do you think? |
|
@Aster89 |
I had no idea! Great, so there's also Actually, @fendor, I understand that haskell-language-server/plugins/hls-ormolu-plugin/src/Ide/Plugin/Ormolu.hs Lines 184 to 190 in cdd7d60 The example you give, instead, uses these two descriptors, haskell-language-server/plugins/hls-cabal-plugin/test/Utils.hs Lines 20 to 24 in cdd7d60 that share the same What do you suggest? |
|
Based on https://github.com/haskell/haskell-language-server/actions/runs/41673433111/job/126047852893?pr=5154, using Besides, I should follow the recommended action at https://github.com/haskell/haskell-language-server/actions/runs/41673433111/job/126047853010?pr=5154 |
149aaf5 to
1dbd866
Compare
fendor
left a comment
There was a problem hiding this comment.
To make these tests resemble their previous behaviour, we should be launching HLS as closely to the final haskell-language-server binary as possible. Thus, I suggest to use idePlugins and avoid the CPP by using requiresOrmoluPlugin and requiresFourmoluPlugin test combinators.
Avoid `#if`-branching on the presence/absence of the plugins, and use `idePlugins` to retrieve the currently available plugins (as determined by the passed `Config`). --- I think there's definitely some flakiness around, as I've very sparingly observed the failure below. It's not unlikely that we just need to serialize tests a bit more, which I only partly did via haskell#5152. ``` haskell-language-server part 1 plugin config generic plugin config custom defaults: FAIL Exception: ghc-internal:GHC.Internal.IO.Exception.IOException: /home/enrico/haskell-language-server/test/testdata/diagnostics/test/testdata/diagnostics: changeWorkingDirectory: does not exist (No such file or directory) HasCallStack backtrace: ioError, called at libraries/unix/System/Posix/PosixPath/FilePath.hsc:106:5 in unix-2.8.8.0-fd61:System.Posix.PosixPath.FilePath Use -p '$0=="haskell-language-server.part 1.plugin config.generic plugin config.custom defaults"' to rerun this test only. custom defaults and user config on some other plugin: OK (0.43s) custom defaults and non overlapping user config: FAIL Exception: ghc-internal:GHC.Internal.IO.Exception.IOException: /home/enrico/haskell-language-server/test/testdata/diagnostics/test/testdata/diagnostics: changeWorkingDirectory: does not exist (No such file or directory) HasCallStack backtrace: ioError, called at libraries/unix/System/Posix/PosixPath/FilePath.hsc:106:5 in unix-2.8.8.0-fd61:System.Posix.PosixPath.FilePath Use -p '/custom defaults and non overlapping user config/' to rerun this test only. custom defaults and overlapping user plugin config: FAIL Exception: ghc-internal:GHC.Internal.IO.Exception.IOException: /home/enrico/haskell-language-server/test/testdata/diagnostics/test/testdata/diagnostics: changeWorkingDirectory: does not exist (No such file or directory) HasCallStack backtrace: ioError, called at libraries/unix/System/Posix/PosixPath/FilePath.hsc:106:5 in unix-2.8.8.0-fd61:System.Posix.PosixPath.FilePath Use -p '/custom defaults and overlapping user plugin config/' to rerun this test only. custom defaults and non plugin user config: OK (0.24s) generate schema vscode-extension-schema: OK (0.47s) generate-default-config: OK (0.48s) plugins-custom-config-markdown-reference: OK (0.47s) part 2 format document lsp formatting provider respects none: OK (0.03s) can change on the fly: OK (0.44s) behaviour on malformed projects Missing module diagnostic: OK (0.86s) Missing module diagnostic - no matching prefix: OK (0.54s) hie-bios loads main-is module: OK (13.91s) window/workDoneProgress sends indefinite progress notifications: OK (0.69s) eval plugin sends progress reports: OK (19.10s) ormolu plugin sends progress notifications: OK (0.98s) fourmolu plugin sends progress notifications: OK (0.75s) 3 out of 17 tests failed (19.58s) ```
fendor
left a comment
There was a problem hiding this comment.
Very good, final nitpicks and then you are good to go :)
Thanks for pushing this through, great improvement!
Ready for review & merge
With this PR we do the transition written in the title.
At least we do so in the
func-tests. Why are we doing this, is written in #5054, which links to #5020, so in essence this is part of the effort to updatecabal-version.Original text (so following messages makes sense)
I'm still experimenting.
For now there's two commits:
ormolu's tests in https://github.com/haskell/haskell-language-server/blob/master/test/functional/Format.hs.runSessionWithServerinstead ofrunSessionWithConfig.Running
cabal run func-test -- -j32results¹ in this error:Looking at #3968 I suspect the error above might ahve to do with ormolu as an external process?
¹ Most of the times; just once I've seen more tests failing, but maybe that's related to some residual flakiness that I can't easily reproduce, having tried 5 more times.
Fixes #5054