tasty-flaky: Handle flaky Tasty-based tests

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

Handle flaky Tasty-based tests, with configuration retry policies.


[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

Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.14 && <4.21), retry (>=0.7 && <0.10), tagged (>=0.5 && <0.9), tasty (>=1.5 && <1.6) [details]
Tested with ghc ==9.10.1 || ==9.8.2 || ==9.6.6 || ==9.4.8 || ==9.2.8 || ==9.0.2 || ==8.10.7
License BSD-3-Clause
Copyright (c) Laurent René de Cotret
Author Laurent René de Cotret
Maintainer Laurent René de Cotret
Revised Revision 1 made by LaurentRDC at 2024-10-22T16:57:54Z
Category Testing
Home page https://github.com/LaurentRDC/tasty-flaky
Source repo head: git clone https://github.com/LaurentRDC/tasty-flaky
Uploaded by LaurentRDC at 2024-09-25T11:38:17Z
Distributions
Downloads 27 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-09-25 [all 1 reports]

Readme for tasty-flaky-0.1.0.0

[back to package description]

tasty-flaky

This provides tasty integration for flaky tests, which are tests that are known to fail intermittently.

Example usage

This package provides a single function, flakyTest, which can attach retrying logic to any test. For example, you can retry test cases from tasty-hunit like so:

import Test.Tasty.HUnit ( testCase ) -- from tasty-hunit

myFlakyTest :: TestTree
myFlakyTest 
    = flakyTest (limitRetries 5 <> constantDelay 1000) 
    $ testCase "some test case" 
    $ do ... 

In the example above, the test will be retried up to 5 times, with a delay of 1000 microseconds between tries, if a failure occurs.