on master help sign in
Use tasty-rerun to allow rerunning failed tests only (#484)

Use by stack --stack-yaml=stack84.yaml test --test-arguments "--rerun"

commit111b6855e2c4f628c64f4e3c7b6291de5b7e2233 authorAlan Zimmerman <alan.zimm@gmail.com> dateMon 16 Mar 2020, 08:07 (7 years ago) parentc74e9b5
6 files changed+18−1
.gitignore+1 README.md+7 ghcide.cabal+1 stack.yaml+1 stack84.yaml+6 test/exe/Main.hs+2−1
.gitignore+1
@@ -4,3 +4,4 @@ dist-newstyle/
44cabal.project.local
55*~
66*.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.,
254254running `stack test` will execute the test suite.
255255If 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`.
256256
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+
257264### Building the extension
258265
259266For development, you can also the VSCode extension from this repository (see
ghcide.cabal+1
@@ -255,6 +255,7 @@ test-suite ghcide-tests
255255 tasty-expected-failure,
256256 tasty-hunit,
257257 tasty-quickcheck,
258+ tasty-rerun,
258259 text
259260 hs-source-dirs: test/cabal test/exe test/src
260261 include-dirs: include
stack.yaml+1
@@ -13,5 +13,6 @@ extra-deps:
1313- shake-0.18.5
1414- parser-combinators-1.2.1
1515- haddock-library-1.8.0
16+- tasty-rerun-1.1.17
1617nix:
1718 packages: [zlib]
stack84.yaml+6
@@ -22,5 +22,11 @@ extra-deps:
2222- unordered-containers-0.2.10.0
2323- file-embed-0.0.11.2
2424- 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
2531nix:
2632 packages: [zlib]
test/exe/Main.hs+2−1
@@ -39,12 +39,13 @@ import Test.QuickCheck
3939import Test.QuickCheck.Instances ()
4040import Test.Tasty
4141import Test.Tasty.ExpectedFailure
42+import Test.Tasty.Ingredients.Rerun
4243import Test.Tasty.HUnit
4344import Test.Tasty.QuickCheck
4445import Data.Maybe
4546
4647main :: IO ()
47−main = defaultMain $ testGroup "HIE"
48+main = defaultMainWithRerun $ testGroup "HIE"
4849 [ testSession "open close" $ do
4950 doc <- openDoc' "Testing.hs" "haskell" ""
5051 void (skipManyTill anyMessage message :: Session WorkDoneProgressCreateRequest)