on master help sign in
Use tasty-rerun to allow rerunning failed tests only (#484)
111b685Alan Zimmerman
.gitignore+1
@@ -4,3 +4,4 @@ dist-newstyle/
4cabal.project.local
4cabal.project.local
5*~
5*~
6*.lock
6*.lock
7+/.tasty-rerun-log
README.md+7
@@ -254,6 +254,13 @@ To build and work on `ghcide` itself, you can use Stack or cabal, e.g.,
254running `stack test` will execute the test suite.
254running `stack test` will execute the test suite.
255If you are using Windows, you should disable the `auto.crlf` setting and configure your editor to use LF line endings, directly or making it use the existing `.editor-config`.
255If you are using Windows, you should disable the `auto.crlf` setting and configure your editor to use LF line endings, directly or making it use the existing `.editor-config`.
256
256
257+If you are chasing down test failures, you can use the tasty-rerun feature by running tests as
258+
259+ stack --stack-yaml=stack84.yaml test --test-arguments "--rerun"
260+
261+This writes a log file called `.tasty-rerun-log` of the failures, and only runs those.
262+See the [tasty-rerun](https://hackage.haskell.org/package/tasty-rerun-1.1.17/docs/Test-Tasty-Ingredients-Rerun.html) documentation for other options.
263+
257### Building the extension
264### Building the extension
258
265
259For development, you can also the VSCode extension from this repository (see
266For development, you can also the VSCode extension from this repository (see
ghcide.cabal+1
@@ -255,6 +255,7 @@ test-suite ghcide-tests
255 tasty-expected-failure,
255 tasty-expected-failure,
256 tasty-hunit,
256 tasty-hunit,
257 tasty-quickcheck,
257 tasty-quickcheck,
258+ tasty-rerun,
258 text
259 text
259 hs-source-dirs: test/cabal test/exe test/src
260 hs-source-dirs: test/cabal test/exe test/src
260 include-dirs: include
261 include-dirs: include
stack.yaml+1
@@ -13,5 +13,6 @@ extra-deps:
13- shake-0.18.5
13- shake-0.18.5
14- parser-combinators-1.2.1
14- parser-combinators-1.2.1
15- haddock-library-1.8.0
15- haddock-library-1.8.0
16+- tasty-rerun-1.1.17
16nix:
17nix:
17 packages: [zlib]
18 packages: [zlib]
stack84.yaml+6
@@ -22,5 +22,11 @@ extra-deps:
22- unordered-containers-0.2.10.0
22- unordered-containers-0.2.10.0
23- file-embed-0.0.11.2
23- file-embed-0.0.11.2
24- heaps-0.3.6.1
24- heaps-0.3.6.1
25+
26+# For tasty-retun
27+- ansi-terminal-0.10.3
28+- ansi-wl-pprint-0.6.9
29+- tasty-1.2.3
30+- tasty-rerun-1.1.17
25nix:
31nix:
26 packages: [zlib]
32 packages: [zlib]
test/exe/Main.hs+2−1
@@ -39,12 +39,13 @@ import Test.QuickCheck
39import Test.QuickCheck.Instances ()
39import Test.QuickCheck.Instances ()
40import Test.Tasty
40import Test.Tasty
41import Test.Tasty.ExpectedFailure
41import Test.Tasty.ExpectedFailure
42+import Test.Tasty.Ingredients.Rerun
42import Test.Tasty.HUnit
43import Test.Tasty.HUnit
43import Test.Tasty.QuickCheck
44import Test.Tasty.QuickCheck
44import Data.Maybe
45import Data.Maybe
45
46
46main :: IO ()
47main :: IO ()
47−main = defaultMain $ testGroup "HIE"
48+main = defaultMainWithRerun $ testGroup "HIE"
48 [ testSession "open close" $ do
49 [ testSession "open close" $ do
49 doc <- openDoc' "Testing.hs" "haskell" ""
50 doc <- openDoc' "Testing.hs" "haskell" ""
50 void (skipManyTill anyMessage message :: Session WorkDoneProgressCreateRequest)
51 void (skipManyTill anyMessage message :: Session WorkDoneProgressCreateRequest)