diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8619c683b..11a634389e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -107,16 +107,12 @@ jobs: # run the tests without parallelism, otherwise tasty will attempt to run # all functional test cases simultaneously which causes way too many hls # instances to be spun up for the poor github actions runner to handle + # + # See https://github.com/ocharles/tasty-rerun/issues/22 for why we need + # to include 'new' in the filters, since many of our test suites are in the + # same package. run: | - echo "TEST_OPTS=-j1 --rerun-update --rerun-filter failures,exceptions" >> $GITHUB_ENV - - - name: Cache test log between attempts of the same run - uses: actions/cache@v3 - env: - cache-name: cache-test-log - with: - path: "**/.tasty-rerun-log*" - key: v1-${{ runner.os }}-${{ matrix.ghc }}-test-log-${{ github.sha }} + echo "TEST_OPTS=-j1 --rerun-update --rerun-filter failures,exceptions,new" >> $GITHUB_ENV - if: matrix.test name: Test hls-graph @@ -236,7 +232,7 @@ jobs: ## version needs to be limited since the tests depend on cabal-fmt which only builds using specific ghc versions - if: matrix.test && matrix.ghc == '9.2' name: Test hls-cabal-fmt-plugin test suite - run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin-tests --flag=isolateTests --test-options="$TEST_OPTS" + run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin-tests --flag=isolateCabalfmtTests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-cabal-plugin test suite diff --git a/plugins/hls-eval-plugin/test/Main.hs b/plugins/hls-eval-plugin/test/Main.hs index 3b34c1130f..fb67a81062 100644 --- a/plugins/hls-eval-plugin/test/Main.hs +++ b/plugins/hls-eval-plugin/test/Main.hs @@ -131,7 +131,7 @@ tests = , goldenWithEvalAndFs "Transitive local dependency" (FS.directProjectMulti ["TTransitive.hs", "TLocalImport.hs", "Util.hs"]) "TTransitive" "hs" -- , goldenWithEval "Local Modules can be imported in a test" "TLocalImportInTest" "hs" , goldenWithEval "Setting language option TupleSections" "TLanguageOptionsTupleSections" "hs" - , goldenWithEval' ":set accepts ghci flags" "TFlags" "hs" (if ghcVersion >= GHC92 then "ghc98.expected" else if ghcVersion >= GHC92 then "ghc92.expected" else "expected") + , goldenWithEval' ":set accepts ghci flags" "TFlags" "hs" (if ghcVersion >= GHC98 then "ghc98.expected" else if ghcVersion >= GHC92 then "ghc92.expected" else "expected") , testCase ":set -fprint-explicit-foralls works" $ do evalInFile "T8.hs" "-- >>> :t id" "-- id :: a -> a" evalInFile "T8.hs" "-- >>> :set -fprint-explicit-foralls\n-- >>> :t id" @@ -141,11 +141,11 @@ tests = , goldenWithEval "The default language extensions for the eval plugin are the same as those for ghci" "TSameDefaultLanguageExtensionsAsGhci" "hs" , goldenWithEval "IO expressions are supported, stdout/stderr output is ignored" "TIO" "hs" , goldenWithEvalAndFs "Property checking" cabalProjectFS "TProperty" "hs" - , goldenWithEvalAndFs' "Property checking with exception" cabalProjectFS "TPropertyError" "hs" ( - if ghcVersion >= GHC96 then + , knownBrokenInEnv [HostOS Windows] "The output has path separators in it, which on Windows look different. Just skip it there" $ goldenWithEvalAndFs' "Property checking with exception" cabalProjectFS "TPropertyError" "hs" ( + if ghcVersion >= GHC98 then + "ghc98.expected" + else if ghcVersion >= GHC96 then "ghc96.expected" - else if ghcVersion >= GHC94 && hostOS == Windows then - "windows-ghc94.expected" else if ghcVersion >= GHC94 then "ghc94.expected" else diff --git a/plugins/hls-eval-plugin/test/testdata/T14.ghc98.expected.hs b/plugins/hls-eval-plugin/test/testdata/T14.ghc98.expected.hs new file mode 100644 index 0000000000..61ee830fa1 --- /dev/null +++ b/plugins/hls-eval-plugin/test/testdata/T14.ghc98.expected.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TypeApplications #-} +module T14 where + +foo :: Show a => a -> String +foo = show + +-- >>> :type foo @Int +-- foo @Int :: Show Int => Int -> String diff --git a/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs b/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs index 2c8e0ef92a..2e4de4c0b7 100644 --- a/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs +++ b/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs @@ -21,7 +21,6 @@ Options apply only in the section where they are defined (unless they are in the >>> class L a b c Too many parameters for class `L' -(Enable MultiParamTypeClasses to allow multi-parameter classes) In the class declaration for `L' -} @@ -33,7 +32,6 @@ Not set yet: >>> class D No parameters for class `D' -(Enable MultiParamTypeClasses to allow no-parameter classes) In the class declaration for `D' Now it works: @@ -57,7 +55,7 @@ It still works {- Invalid option/flags are reported, but valid ones will be reflected >>> :set -XRank2Types -XAbsent -XDatatypeContexts -XWrong -fprint-nothing-at-all -: warning: +: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. Some flags have not been recognized: -XAbsent, -XWrong, -fprint-nothing-at-all diff --git a/plugins/hls-eval-plugin/test/testdata/TPropertyError.windows-ghc94.expected.hs b/plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc98.expected.hs similarity index 61% rename from plugins/hls-eval-plugin/test/testdata/TPropertyError.windows-ghc94.expected.hs rename to plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc98.expected.hs index 6c7813d776..9fc0848785 100644 --- a/plugins/hls-eval-plugin/test/testdata/TPropertyError.windows-ghc94.expected.hs +++ b/plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc98.expected.hs @@ -6,8 +6,8 @@ module TProperty where -- Exception: -- Prelude.head: empty list -- CallStack (from HasCallStack): --- error, called at libraries\base\GHC\List.hs:1646:3 in base:GHC.List --- errorEmptyList, called at libraries\base\GHC\List.hs:85:11 in base:GHC.List --- badHead, called at libraries\base\GHC\List.hs:81:28 in base:GHC.List +-- error, called at libraries/base/GHC/List.hs:1782:3 in base:GHC.List +-- errorEmptyList, called at libraries/base/GHC/List.hs:89:11 in base:GHC.List +-- badHead, called at libraries/base/GHC/List.hs:83:28 in base:GHC.List -- head, called at :1:27 in interactive:Ghci2 -- []