Skip to content

Commit

Permalink
Keep tests only for GHC 9
Browse files Browse the repository at this point in the history
  • Loading branch information
berberman committed Jul 4, 2021
1 parent 1a8fa2c commit 2cddd76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
name: Test hls-class-plugin
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"

- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test && matrix.ghc == '9.0.1' }}
name: Test hls-eval-plugin
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"

Expand Down
5 changes: 4 additions & 1 deletion hls-test-utils/src/Test/Hls/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ data GhcVersion
| GHC88
| GHC86
| GHC84
| GHC901
deriving (Eq,Show)

ghcVersion :: GhcVersion
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)))
#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(9,0,1,0)))
ghcVersion = GHC901
#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)))
ghcVersion = GHC810
#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,8,0,0)))
ghcVersion = GHC88
Expand Down
6 changes: 5 additions & 1 deletion plugins/hls-eval-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ import System.FilePath ((</>))
import Test.Hls

main :: IO ()
main = defaultTestRunner tests
main = defaultTestRunner $ if ghcVersion == GHC901 then tests else dummyTestCase

-- | Now we only maintain test cases for GHC 9.0.1
dummyTestCase :: TestTree
dummyTestCase = testCase "Tests are skipped before GHC 9.0.1" $ pure ()

evalPlugin :: PluginDescriptor IdeState
evalPlugin = Eval.descriptor "eval"
Expand Down

0 comments on commit 2cddd76

Please sign in to comment.