tasty-flaky: Handle flaky Tasty-based tests

[ bsd3, library, testing ] [ Propose Tags ]

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


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

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]
License BSD-3-Clause
Copyright (c) Powerweave Inc.
Author Laurent René de Cotret
Maintainer laurent@powerweave.io
Category Testing
Home page https://github.com/PowerweaveInc/tasty-flaky
Source repo head: git clone https://github.com/PowerweaveInc/tasty-flaky.git
Uploaded by LaurentRDC at 2024-09-25T11:38:17Z
Distributions
Downloads 11 total (11 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.