Skip to main content

Github actions plugin to check flakiness of tests by calculating fliprates.

Project description

flaky_tests_detection

Github actions plugin to check flakiness of tests by calculating fliprates. Usage demonstrated here 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:
    • n days.
    • n runs.
  • 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_identifier and test_status.
  • --junit-files
    • Give a path to a folder with JUnit test results.

Calculation options

  • --grouping-option

    • days to use n days for fliprate calculation windows.
    • runs to use n runs for fliprate calculation windows.
  • --window-size

    • Fliprate calculation window size n.
  • --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.csv with 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
  • JUnit files 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.csv with 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 scope of IVVES project. This work was labelled by ITEA3 and funded by local authorities under grant agreement “ITEA-2019-18022-IVVES”

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flaky-tests-detection-1.2.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flaky_tests_detection-1.2.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file flaky-tests-detection-1.2.1.tar.gz.

File metadata

  • Download URL: flaky-tests-detection-1.2.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for flaky-tests-detection-1.2.1.tar.gz
Algorithm Hash digest
SHA256 976b07c5aac6f1e9f9e3a2a92866b2fb1b7c784d651c3534eafd541b5cc4c08f
MD5 86f516b1983faf49257b86c8ed7087e6
BLAKE2b-256 d64769d3a8046f1de4854df3b8a4385126b2657be52d2681cc5ed51b9a946551

See more details on using hashes here.

File details

Details for the file flaky_tests_detection-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: flaky_tests_detection-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for flaky_tests_detection-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1e66543903cffd1d16f9ee19873d6ef01fb84238383a258338ed56bd867f8aa
MD5 a9195c13be1aab3762e6a038e4b36fec
BLAKE2b-256 d1bdd3eac0874f36ad3dd2f74b3b4fcb451476e6f401e3b9028438e4b8bd7cd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page