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

[ bsd3, library, testing ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11, 1.1.12, 1.1.13, 1.1.14, 1.1.15, 1.1.16, 1.1.17, 1.1.18, 1.1.19 (info)
Change log Changelog.md
Dependencies base (>=4.6 && <4.21), containers (>=0.5.0.0 && <0.8), mtl (>=2.1.2 && <2.4), optparse-applicative (>=0.6 && <0.19), split (>=0.1 && <0.3), stm (>=2.4.2 && <2.6), tagged (>=0.7 && <0.9), tasty (>=1.2 && <1.6), transformers (>=0.3.0.0 && <0.7) [details]
Tested with ghc ==9.8.1, ghc ==9.6.2, ghc ==9.4.5, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2, ghc ==7.10.3, ghc ==7.8.4, ghc ==7.6.3
License BSD-3-Clause
Copyright Oliver Charles (c) 2014, Andrew Lelechenko (c) 2019
Author Oliver Charles
Maintainer ollie@ocharles.org.uk
Revised Revision 3 made by Bodigrim at 2024-03-15T20:19:59Z
Category Testing
Home page http://github.com/ocharles/tasty-rerun
Source repo head: git clone https://github.com/ocharles/tasty-rerun
Uploaded by Bodigrim at 2023-09-10T00:17:00Z
Distributions Arch:1.1.19, Debian:1.1.17, Fedora:1.1.18, LTSHaskell:1.1.19, NixOS:1.1.19, Stackage:1.1.19, openSUSE:1.1.19
Reverse Dependencies 4 direct, 0 indirect [details]
Downloads 30953 total (237 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-09-10 [all 1 reports]

Readme for tasty-rerun-1.1.19

[back to package description]

tasty-rerun

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.

For example, tasty-rerun allows:

  • Rerun only tests, which failed during the last run (--rerun). Combined with live reloading (e. g., using ghcid or stack test --file-watch), it gives an ultimate power to focus on broken parts and put them back in shape, enjoying a tight feedback loop.
  • Rerun only tests, which have beed added since the last saved test run. This comes handy when writing a new module, which does not affect other parts of the system, or adding new test cases.
  • Rerun only tests, which passed during the last saved test run. Sometimes a part of the test suite is consistently failing (e. g., an external service is temporarily down), but you want be sure that you are not breaking anything else in course of your work.

To add it to your test suite just replace Test.Tasty.defaultMain with Test.Tasty.Ingredients.Rerun.defaultMainWithRerun:

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

main :: IO ()
main = defaultMainWithRerun tests

tests :: TestTree
tests = undefined

Use --help to list 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).