Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit a17fc7c

Browse files
committed
Try warming up HIE cache beforehand in functional tests
1 parent 72854e4 commit a17fc7c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/functional/DiagnosticsSpec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Utils
1717

1818
spec :: Spec
1919
spec = describe "diagnostics providers" $ do
20-
describe "diagnostics triggers" $ do
20+
describe "diagnostics triggers" $
2121
it "runs diagnostics on save" $
2222
runSession hieCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do
2323
-- runSessionWithConfig logConfig hieCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do

test/functional/Main.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
module Main where
22

3-
import Test.Hspec
3+
import Control.Monad.IO.Class
4+
import Language.Haskell.LSP.Test
45
import qualified FunctionalSpec
5-
import TestUtils
6+
import Test.Hspec
7+
import TestUtils
68

79
main :: IO ()
810
main = do
911
setupStackFiles
12+
-- run a test session to warm up the cache to prevent timeouts in other tests
13+
putStrLn "Warming up HIE cache..."
14+
runSessionWithConfig (defaultConfig { messageTimeout = 120 }) hieCommand fullCaps "test/testdata" $
15+
liftIO $ putStrLn "HIE cache is warmed up"
1016
-- withFileLogging "functional.log" $ hspec FunctionalSpec.spec
1117
withFileLogging logFilePath $ hspec FunctionalSpec.spec

0 commit comments

Comments
 (0)