tasty-flaky: Handle flaky Tasty-based tests

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.1.1.0
Change log CHANGELOG.md
Dependencies base (>=4.17 && <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-24T20:51:39Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


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.