Skip to main content

flakeguard

Your test suite is lying to you.

flakeguard demo

Flakeguard finds the tests that randomly pass and fail, ranks them by how unreliable they are, and shows you why — so you can trust your tests again.

Free · private · works with any language. No account, no sign-up, and nothing leaves your machine.

CI License: MIT Python 3.9+


The problem, in 30 seconds

You have a test that fails once in a while. You re-run it. It passes. Was that a real bug? A flaky test? Nobody knows — so everyone ignores it, and that is exactly how real bugs hide.

A flaky test costs a team hours, and slowly destroys trust in the entire test suite. Flakeguard fixes the hard half of the problem: it tells you exactly which tests are unreliable, and how unreliable.

Try it in 60 seconds

pipx install flakeguard
flakeguard scan ./reports        # a folder of test reports

No reports yet? Run it against the examples bundled in this repo:

git clone https://github.com/PrathameshKulkarni2k4/flakeguard
cd flakeguard
flakeguard scan examples/reports

What it does

  • Reads your test results from many runs (the more runs, the sharper the picture).
  • Finds the tests that disagree with themselves across those runs.
  • Gives each one a score from 0 (solid) to 1 (a coin-flip).
  • Shows the latest failure message, so you can go fix it.
  • Runs in your CI and can leave a comment on the pull request — or block it when flakiness spikes.

Works with any language

Flakeguard reads JUnit XML, the report format almost every test framework can produce. One tool, every language:

Language / framework How to produce the report
Python (pytest) pytest --junitxml=report.xml
Java (Maven / Gradle) Surefire writes JUnit XML automatically
Go gotestsum --junitfile report.xml
JavaScript (Jest) the jest-junit reporter
Ruby (RSpec) the rspec_junit_formatter gem
.NET, PHPUnit, … built-in or plugin JUnit output

Flakeguard also reads TAP (the Test Anything Protocol), produced by Node's built-in test runner, the tap/tape libraries, Perl's Test::More and others.

Use in CI (GitHub Actions)

- name: Flakeguard
  uses: PrathameshKulkarni2k4/flakeguard@main
  with:
    reports: reports      # dir/glob of JUnit XML files
    min-runs: 3           # ignore tests seen in fewer runs
    max-flaky: 0          # fail if any flaky test is found (-1 = never fail)
    comment: "true"       # post the report as a PR comment

See .github/workflows/example.yml for a complete workflow that runs a suite several times and feeds the reports in.

To gate locally or in any other CI, use the exit code:

flakeguard scan ./reports --fail-on-flaky   # exits 1 if anything is flaky

How the score works

For each test we count passes vs. non-passes across all runs (skips are ignored). The flakiness score is:

score = 2 * min(passes, failures) / (passes + failures)
  • always passes, or always fails → 0.0 (consistent, not flaky)
  • flips on every run (50/50) → 1.0 (maximally flaky)

It is deliberately explainable — no black box. You can read the number and know exactly how it was derived.

Roadmap

  • JUnit XML parsing, flakiness scoring, text/JSON/Markdown reports
  • GitHub Action with PR comments and a flakiness budget
  • TAP report format
  • Native JSON report formats
  • CI history so it learns across builds
  • Failure-signature clustering (group the same flake across tests)
  • Quarantine file so known flakes are set aside, not deleted

Contributing

Contributions are very welcome — see CONTRIBUTING.md. Adding support for a new report format is a great first contribution and is designed to be small. Please be kind; this project follows a Code of Conduct.

License

MIT — see LICENSE.

Metadata

Release files for flakeguard 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flakeguard 0.2.0
File Size Uploaded Provenance Actions
flakeguard-0.2.0.tar.gz 188.1 kB With provenance Details for flakeguard-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flakeguard 0.2.0
File Interpreter ABI Platform Actions
flakeguard-0.2.0-py3-none-any.whl Python 3 none any Details for flakeguard-0.2.0-py3-none-any.whl

Total release size: 203.0 kB

Release files / flakeguard-0.2.0.tar.gz

Download URL flakeguard-0.2.0.tar.gz
Size 188.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf2af38824828a5320ebc340be08a51a5d78361007f517b37db069c9479a2b16
BLAKE2b-256 checksum
How to use checksums
ce4e5dd54c4fd7630c407c7abaf0ccd89b9ff5eb0beff002182f77f4b4820b24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / flakeguard-0.2.0-py3-none-any.whl

Download URL flakeguard-0.2.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d95ad6ae6cb8bb6ce17afca0858c6c3984ee0d5c8100b0886f152feb08c6790d
BLAKE2b-256 checksum
How to use checksums
854a4fe09e8ae73168fc4ece47bd76e2dd9c913c3de4aa0c7dc1bb1486d833e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for flakeguard 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flakeguard-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page