From e181bb935578aadb8b129c52fea2f7354e684a3d Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Wed, 17 Jul 2024 00:30:07 +0200 Subject: [PATCH] Add tasty-rerun to test-suites --- .gitignore | 3 ++- ouroboros-consensus/ouroboros-consensus.cabal | 1 + .../src/unstable-consensus-testlib/Test/Util/TestEnv.hs | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9614c9a46a..865478bb77 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -96,4 +97,4 @@ cabal.sandbox.config cabal.project.local cabal.project.local~ .HTF/ -.ghc.environment.* \ No newline at end of file +.ghc.environment.* diff --git a/ouroboros-consensus/ouroboros-consensus.cabal b/ouroboros-consensus/ouroboros-consensus.cabal index b5948ce8a3..695668cff9 100644 --- a/ouroboros-consensus/ouroboros-consensus.cabal +++ b/ouroboros-consensus/ouroboros-consensus.cabal @@ -421,6 +421,7 @@ library unstable-consensus-testlib tasty-golden, tasty-hunit, tasty-quickcheck >=0.11, + tasty-rerun, template-haskell, text, time, diff --git a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/TestEnv.hs b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/TestEnv.hs index 4bc89e0de9..d7e9ce8421 100644 --- a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/TestEnv.hs +++ b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/TestEnv.hs @@ -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 @@ -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)]