Skip to content

Smartesting/flaky-test-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

44b8b43 · Jul 20, 2023

History

39 Commits
Feb 27, 2023
Jan 10, 2023
Feb 27, 2023
Feb 27, 2023
Jul 20, 2023
Jan 10, 2023
Jan 10, 2023
Jan 10, 2023
Jan 13, 2023
Feb 27, 2023
Jul 20, 2023
Feb 27, 2023
Jan 13, 2023
Feb 27, 2023
Jul 20, 2023
Jul 20, 2023
Jan 10, 2023
Feb 27, 2023

Repository files navigation

@smartesting/flaky-test-detector

Node.js CI

KISS approach for flaky test detection:

  • run the tests n times
  • check the results
  • find tests which do not have consistent results

Installing

npm i @smartesting/flaky-test-detector

Detect flaky tests

Add a target in your package.json file:

{
  "scripts": {
    "detectFlaky": "flaky-test-detector.ts --run-tests \"npm run test\" --test-output-file=./test-results.xml --test-output-format=junit --repeat=5"
  }
}

The script takes four arguments:

  • run-tests: the command used to execute the tests
  • test-output-file: the file in which the test runner will output the result. Only JUnit reports are supported for now
  • test-output-format: the test result format of the test output file. Should be junitor cucumberJson
  • repeat: the number of time the tests will be executed