Flaky tests detection
Visualize tests whose state changes most often. During software development, it is often common that some tests start to randomly fail,
but finding those tests is a tedious and time consuming problem. Flaky tests detection solves that problem by processing historical xunit test
results and checks which tests changes state most often. Flaky tests detection is available as Github Action plugin and
Python package. For usage, see example
at the actions page.
Implementation is based on "Modeling and ranking flaky tests at Apple" by Kowalczyk, Emily & Nair, Karan & Gao, Zebao & Silberstein, Leo & Long, Teng & Memon, Atif.
Features
- Prints out top test names and their latest calculation window scores (normal fliprate and exponentially weighted moving average fliprate that take previous calculation windows into account).
- Calculation grouping options:
ndays.nruns.
- Heatmap visualization of the scores and history.
Parameters
Data options (choose one)
--test-history-csv- Give a path to a test history csv file which includes three fields:
timestamp,test_identifierandtest_status.
- Give a path to a test history csv file which includes three fields:
--junit-files- Give a path to a folder with
JUnittest results.
- Give a path to a folder with
Calculation options
-
--grouping-optiondaysto usendays for fliprate calculation windows.runsto usenruns for fliprate calculation windows.
-
--window-size- Fliprate calculation window size
n.
- Fliprate calculation window size
-
--window-count- History size for exponentially weighted moving average calculations.
-
--top-n- How many top highest scoring tests to print out.
Heatmap generation
--heatmap- Turn heatmap generation on.
- Two pictures generated: normal fliprate and exponentially weighted moving average fliprate score.
- Same parameters used as with the printed statistics.
Full examples
- Precomputed
test_history.csvwith daily calulations. 1 day windows, 7 day history and 5 tests printed out.--test-history-csv=example_history/test_history.csv --grouping-option=days --window-size=1 --window-count=7 --top-n=5
JUnitfiles with calculations per 5 runs. 15 runs history and 5 tests printed out.--junit-files=example_history/junit_files --grouping-option=runs --window-size=5 --window-count=3 --top-n=5
- Precomputed
test_history.csvwith daily calculations and heatmap generation. 1 day windows, 7 day history and 50 tests printed and generated to heatmaps.--test-history-csv=example_history/test_history.csv --grouping-option=days --window-size=1 --window-count=7 --top-n=50 --heatmap
Install module
make install
Install module and development packages
make install_dev
Run pytest
make run_test
Acknowledgement
The package was developed by F-Secure Corporation and University of Helsinki in the scope of IVVES project. This work was labelled by ITEA3 and funded by local authorities under grant agreement “ITEA-2019-18022-IVVES”
Metadata
Release files for flaky-tests-detection 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flaky-tests-detection-1.3.0.tar.gz | 10.4 kB | Without provenance | Details for flaky-tests-detection-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flaky_tests_detection-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for flaky_tests_detection-1.3.0-py3-none-any.whl |
Total release size: 21.4 kB
Release files / flaky-tests-detection-1.3.0.tar.gz
| Download URL | flaky-tests-detection-1.3.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a585d3b5d3918bc766e974528cdaa5f79d868559e7548fbc0fc6331fa9bd24a
|
|
BLAKE2b-256 checksum How to use checksums |
de33f6e1d27d107416507ba2259b290969eb5fe90650b6f5a19f5fae5147e708
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.1.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.9
|
Release files / flaky_tests_detection-1.3.0-py3-none-any.whl
| Download URL | flaky_tests_detection-1.3.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
887de456a524eb2da6c216719b7d2256ff534a52c8e525158892d562106f1dc5
|
|
BLAKE2b-256 checksum How to use checksums |
e3aab84e774e08154a1ba8c02377f983b07a02b6ce4cb0ef08d66a9dae4d8163
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.2 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/5.1.0 keyring/23.11.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.9
|
Security for flaky-tests-detection 1.3.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.