fickle

Crates.iofickle
lib.rsfickle
version0.3.0
sourcesrc
created_at2024-09-29 03:06:39.955495
updated_at2024-10-02 00:22:39.939214
descriptionTools for handling fickle (flaky) tests in rust.
homepage
repositoryhttps://git.sr.ht/~ryguy/fickle
max_upload_size
id1390548
size56,203
Ryan Crisanti (rcrisanti)

documentation

README

fickle

Handle fickle (flaky) tests in rust.

Usage

The primary api is to use the [fickle] macro attribute like this:

#[test]
#[fickle]
fn flaky_test() {
    // your test here
}

By default, it will re-run your test 1 time (if the first time fails). If you want to allow more than 1 retry you can specify that with the retries argument.

#[test]
#[fickle(retries=3)]
fn flakier_test() {
    // your test here
}

There is also the option of using the [Fickle] struct (which is what the macro expands to under the hood). This would look something like this

#[test]
fn flaky_test() {
    let fickle = fickle::Fickle::default();
    let block: fn() -> () = || {
        // your test here
    };
    fickle.run(block).unwrap();
}
Commit count: 0

cargo fmt