Skip to content

Commit 2cddd76

Browse files
committed
Keep tests only for GHC 9
1 parent 1a8fa2c commit 2cddd76

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
name: Test hls-class-plugin
171171
run: cabal test hls-class-plugin --test-options="-j1 --rerun-update" || cabal test hls-class-plugin --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-class-plugin --test-options="-j1 --rerun"
172172

173-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
173+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test && matrix.ghc == '9.0.1' }}
174174
name: Test hls-eval-plugin
175175
run: cabal test hls-eval-plugin --test-options="-j1 --rerun-update" || cabal test hls-eval-plugin --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="-j1 --rerun"
176176

hls-test-utils/src/Test/Hls/Util.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ data GhcVersion
112112
| GHC88
113113
| GHC86
114114
| GHC84
115+
| GHC901
115116
deriving (Eq,Show)
116117

117118
ghcVersion :: GhcVersion
118-
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)))
119+
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
120+
ghcVersion = GHC901
121+
#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)))
119122
ghcVersion = GHC810
120123
#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,8,0,0)))
121124
ghcVersion = GHC88

plugins/hls-eval-plugin/test/Main.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ import System.FilePath ((</>))
2020
import Test.Hls
2121

2222
main :: IO ()
23-
main = defaultTestRunner tests
23+
main = defaultTestRunner $ if ghcVersion == GHC901 then tests else dummyTestCase
24+
25+
-- | Now we only maintain test cases for GHC 9.0.1
26+
dummyTestCase :: TestTree
27+
dummyTestCase = testCase "Tests are skipped before GHC 9.0.1" $ pure ()
2428

2529
evalPlugin :: PluginDescriptor IdeState
2630
evalPlugin = Eval.descriptor "eval"

0 commit comments

Comments
 (0)