Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix references to old CPP names in tests, update tests #4159

Merged
merged 4 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/hls-eval-plugin/test/cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
testdata/
info-util/
testdata/info-util/
6 changes: 3 additions & 3 deletions test/functional/Progress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tests =

(codeLensResponse, activeProgressTokens) <- expectProgressMessagesTill
(responseForId SMethod_TextDocumentCodeLens lspId)
["Setting up testdata (for T1.hs)", "Processing", "Indexing"]
["Setting up testdata (for T1.hs)", "Processing"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this Indexing because it was making the test flaky (sometimes appeared after the code lens reponse).
As suggested by @fendor the only Indexing message that happens is related to files not related to this test, so it also semantically doesn't belong here.

[]

-- this is a test so exceptions result in fails
Expand All @@ -59,15 +59,15 @@ tests =
void configurationRequest
setHlsConfig (formatLspConfig "ormolu")
doc <- openDoc "Format.hs" "haskell"
expectProgressMessages ["Setting up testdata (for Format.hs)", "Processing", "Indexing"] []
expectProgressMessages ["Setting up format (for Format.hs)", "Processing", "Indexing"] []
_ <- sendRequest SMethod_TextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing)
expectProgressMessages ["Formatting Format.hs"] []
, requiresFourmoluPlugin $ testCase "fourmolu plugin sends progress notifications" $ do
runSessionWithConfig (def { ignoreConfigurationRequests = False }) hlsLspCommand progressCaps "test/testdata/format" $ do
void configurationRequest
setHlsConfig (formatLspConfig "fourmolu")
doc <- openDoc "Format.hs" "haskell"
expectProgressMessages ["Setting up testdata (for Format.hs)", "Processing", "Indexing"] []
expectProgressMessages ["Setting up format (for Format.hs)", "Processing", "Indexing"] []
_ <- sendRequest SMethod_TextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing)
expectProgressMessages ["Formatting Format.hs"] []
]
Expand Down
8 changes: 4 additions & 4 deletions test/utils/Test/Hls/Flags.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Test.Hls (TestTree, ignoreTestBecause)

-- | Disable test unless the eval flag is set
requiresEvalPlugin :: TestTree -> TestTree
#if eval
#if hls_eval
requiresEvalPlugin = id
#else
requiresEvalPlugin = ignoreTestBecause "Eval plugin disabled"
Expand All @@ -19,23 +19,23 @@ requiresEvalPlugin = ignoreTestBecause "Eval plugin disabled"
-- * Formatters
-- | Disable test unless the floskell flag is set
requiresFloskellPlugin :: TestTree -> TestTree
#if floskell
#if hls_floskell
requiresFloskellPlugin = id
#else
requiresFloskellPlugin = ignoreTestBecause "Floskell plugin disabled"
#endif

-- | Disable test unless the fourmolu flag is set
requiresFourmoluPlugin :: TestTree -> TestTree
#if fourmolu
#if hls_fourmolu
requiresFourmoluPlugin = id
#else
requiresFourmoluPlugin = ignoreTestBecause "Fourmolu plugin disabled"
#endif

-- | Disable test unless the ormolu flag is set
requiresOrmoluPlugin :: TestTree -> TestTree
#if ormolu
#if hls_ormolu
requiresOrmoluPlugin = id
#else
requiresOrmoluPlugin = ignoreTestBecause "Ormolu plugin disabled"
Expand Down
Loading