mark-flaky-tests

Crates.iomark-flaky-tests
lib.rsmark-flaky-tests
version1.0.2
sourcesrc
created_at2023-09-11 18:28:18.008443
updated_at2023-09-11 18:45:16.42751
descriptionMark, debug and auto-retry your flaky tests
homepage
repositoryhttps://github.com/GoldsteinE/mark-flaky-tests/
max_upload_size
id969940
size31,960
Max “Goldstein” Siling (GoldsteinE)

documentation

README

build status docs.rs license is MIT or Apache 2.0

mark-flaky-tests

There're some tests that sometimes pass and sometimes fail. We call them "flaky".

This crate provides a macro attribute #[flaky] that allows you to mark all the flaky tests in your codebase. You then have two options:

  1. In default mode, #[flaky] will retry a test for a few times and pass it if at least one run has passed.
  2. In strict mode, #[flaky] will still run test for a few times, but will only pass it if every run has passed.

To enable strict mode, set the environment variable MARK_FLAKY_TESTS_STRICT=true.

To adjust the amount of times a test is retried, set the environment variable MARK_FLAKY_TESTS_RETRIES to the desired amount. Default is 3.

To use #[flaky] with #[tokio::test], enable the tokio feature.

Tests that return ExitCode are currently not supported due to std API limitations.

Commit count: 7

cargo fmt