Skip to content

Commit

Permalink
Add tasty-rerun to test-suites (#1184)
Browse files Browse the repository at this point in the history
This allows us to do `cabal test all --test-options=--rerun` to only
rerun failed tests.
  • Loading branch information
jasagredo authored Jul 17, 2024
2 parents 8ab2822 + e181bb9 commit ad53873
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ launch-*
/dist-chap
cabal.project.consensus

*/.tasty-rerun-log
ouroboros-consensus-cardano/test/tools-test/disk/chaindb/

# https://github.com/github/gitignore/blob/main/Haskell.gitignore
Expand All @@ -96,4 +97,4 @@ cabal.sandbox.config
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
.ghc.environment.*
1 change: 1 addition & 0 deletions ouroboros-consensus/ouroboros-consensus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ library unstable-consensus-testlib
tasty-golden,
tasty-hunit,
tasty-quickcheck >=0.11,
tasty-rerun,
template-haskell,
text,
time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Main.Utf8 (withStdTerminalHandles)
import Options.Applicative (metavar)
import Test.Tasty
import Test.Tasty.Ingredients
import Test.Tasty.Ingredients.Rerun
import Test.Tasty.Options
import Test.Tasty.QuickCheck

Expand All @@ -26,8 +27,9 @@ defaultMainWithTestEnv :: TestEnvConfig -> TestTree -> IO ()
defaultMainWithTestEnv testConfig testTree = do
cryptoInit
withStdTerminalHandles $
defaultMainWithIngredients (testEnvIngredient : defaultIngredients) $
withTestEnv testConfig testTree
defaultMainWithIngredients
[rerunningTests (testEnvIngredient : defaultIngredients)]
( withTestEnv testConfig testTree )
where
testEnvIngredient :: Ingredient
testEnvIngredient = includingOptions [Option (Proxy :: Proxy TestEnv)]
Expand Down

0 comments on commit ad53873

Please sign in to comment.