haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Extracts ghcide-tests and migrate it to use hls-test-utils

Open soulomoon opened this issue 1 year ago • 1 comments

I think we should pick up https://github.com/haskell/haskell-language-server/pull/3315, This can be served as part of https://github.com/haskell/haskell-language-server/issues/3736, Extracts ghcide-tests, and migrate the test to use hls-test-utils. This can be served as a pre-step to move the all the functionalities of ghcide to the stand alone plugin https://github.com/haskell/haskell-language-server/issues/2979

Some benifits:

  1. Removal of code duplication.
  2. Test speed up, we can refactor the test that is doing unconditional wait along the way.
  3. Test correctness, we can refactor some tests that are not designed properly.

When I have done a proof of concept of https://github.com/haskell/haskell-language-server/issues/2979, I migrate some of the tests to use hls-test-utils, I have some positive result, some tests can be run 2 to 3 times faster.

Jobs that need to be done

  • [ ] merging ghcide-test-utils and hls-test-utils
    • https://github.com/haskell/haskell-language-server/pull/4197
  • [x] move ghcide-tests to haskell-language-server.cabal and make it depend on hls-test-utils #4176
  • [ ] fix up each test to use hls-test-utils.
    • [x] AsyncTests #4199
    • [x] BootTests #4227
    • [x] ClientSettingsTests #4258
    • [x] CodeLensTests https://github.com/haskell/haskell-language-server/pull/4231
    • [x] CompletionTests https://github.com/haskell/haskell-language-server/pull/4192
    • [x] CPPTests https://github.com/haskell/haskell-language-server/pull/4231
    • [x] CradleTests https://github.com/haskell/haskell-language-server/pull/4231
    • [x] DependentFileTest #4195
    • [x] DiagnosticTests https://github.com/haskell/haskell-language-server/pull/4207
    • [x] ExceptionTests #4231
    • [x] FindDefinitionAndHoverTests #4202
    • [x] FuzzySearch
    • [x] GarbageCollectionTests https://github.com/haskell/haskell-language-server/pull/4231
    • HaddockTests
    • HieDbRetry
    • [x] HighlightTests #4202
    • [x] IfaceTests https://github.com/haskell/haskell-language-server/pull/4201
    • [x] InitializeResponseTests
    • LogType
    • [ ] NonLspCommandLine
    • [x] OpenCloseTest #4207
    • [x] OutlineTests #4182
    • [x] PluginSimpleTests #4259
    • PositionMappingTests
    • [x] PreprocessorTests #4260
    • Progress
    • [x] ReferenceTests #4182
    • [x] RootUriTests #4261
    • [ ] SafeTests #4267
    • [ ] SymlinkTests #4266
    • [x] THTests #4231
    • [ ] UnitTests #4268
    • [ ] WatchedFileTests #4269

soulomoon avatar Apr 13 '24 08:04 soulomoon

Since the number of test are so large. IMO, a workable solution is that we refactor one test file at a time, smooth the transition from ghcide-test-util to hls-test-util.

soulomoon avatar Apr 13 '24 15:04 soulomoon

done !

soulomoon avatar Jun 09 '24 09:06 soulomoon

Nice work!

jhrcek avatar Jun 09 '24 10:06 jhrcek