Flakeguard helps you detect flaky tests, quarantine them, and guard your CI pipelines from them.
# Print help output
flakeguard -h
Once you find a flaky test, take a look at our Fixing Flaky Tests Guide for tips and processes to help you debug and narrow down the source of flakes.
There are two modes for running flakeguard, detect
and guard
.
Run tests over and over to figure out which ones are flaky. Best used in a nightly cron job to regularly checkup on your test suite health.
flakeguard detect -h
Guard your CI pipelines from being affected by flaky tests. This will attempt to re-run any failing tests and make them pass so that your PRs and merge queues aren't decimated by getting unlucky with flakes. It will also look for newly added and modified tests and try to determine if your code changes are introducing new flakes.
flakeguard guard -h
For detailed technical design diagrams and decisions, see the Flakeguard Design Doc. For guiding principles for UX, see the Ideal Flakeguard Developer Experiences page.
We use golangci-lint v2 for linting and formatting, and pre-commit for pre-commit and pre-push checks.
pre-commit install # Install our pre-commit scripts
See the Makefile for helpful commands for local development.
make build # Build binaries, results placed in dist/
make lint # Lint and format code
make bench # Run all benchmarks
make test_short # Run only short tests
make test_unit # Run only unit tests
make test_integration # Run only integration tests
make test_full # Run all tests with extensive coverage stats
make test_full_race # Run all tests with extensive coverage stats and race detection
If you use Cursor, you can utilize the Cursor rules included in .cursor/rules to guide suggestions.
FLAKEGUARD_TEST_LOG_LEVEL
Sets the logging level for tests to use, useFLAKEGUARD_TEST_LOG_LEVEL=trace
if you're chasing down confusing bugs.FLAKEGUARD_GOCOVERDIR
Sets the coverage dir for integration tests to utilize. This is handled automatically in mostmake
commands.
A handy debugging setup is available already in the included .vscode folder as "Debug Flakeguard".