tasty-rerun-1.1.17: Rerun only tests which failed in a previous test run

Copyright Oliver Charles (c) 2014 Andrew Lelechenko (c) 2019 BSD3 None Haskell2010

Test.Tasty.Ingredients.Rerun

Description

This ingredient for tasty testing framework allows to filter a test tree depending on an outcome of the previous run. This may be useful in many scenarios, especially when a test suite grows large.

The behaviour is controlled by command-line options:

• --rerun 

Rerun only tests, which failed during the last run. If the last run was successful, execute a full test suite afresh. A shortcut for --rerun-update --rerun-filter failures,exceptions --rerun-all-on-success.

• --rerun-update 

Update the log file to reflect latest test outcomes.

• --rerun-filter CATEGORIES

Read the log file and rerun only tests from a given comma-separated list of categories: failures, exceptions, new, successful. If this option is omitted or the log file is missing, rerun everything.

• --rerun-all-on-success 

If according to the log file and --rerun-filter there is nothing left to rerun, run all tests. This comes especially handy in stack test --file-watch or ghcid scenarios.

• --rerun-log-file FILE

Location of the log file (default: .tasty-rerun-log).

To add it to your test suite just replace defaultMain with defaultMainWithRerun or wrap arguments of defaultMainWithIngredients into rerunningTests.

Synopsis

# Documentation

Drop-in replacement for defaultMain.

import Test.Tasty
import Test.Tasty.Ingredients.Rerun

main :: IO ()
main = defaultMainWithRerun tests

tests :: TestTree
tests = undefined

Ingredient transformer, to use with defaultMainWithIngredients.

import Test.Tasty
import Test.Tasty.Runners
import Test.Tasty.Ingredients.Rerun

main :: IO ()
main =
defaultMainWithIngredients
[ rerunningTests [ listingTests, consoleTestReporter ] ]
tests

tests :: TestTree
tests = undefined