Giter VIP home page Giter VIP logo

kaocha-retry's Introduction

CircleCI

Retry plugin for kaocha

Flakey tests are an issue that affect many people, and they should be handled properly to avoid the flakeyness. However in some cases you might still want to retry flakey tests, in case the failures depend on external transient factors that are hard to control.

This Kaocha plugin will re run tests automatically in a transparent way, but making sure that the retried tests get reported at the end.

How to use it

Add the dependency to your project.clj/deps.edn file with:

Clojars Project

You can enable this plugin globally for all test suites adding :kaocha-retry.plugin/retry to your list of Kaocha plugins.

If you enable it globally you can still disable it by passing:

--no-retry

Otherwise you can just enable it for your own test run with enabling it with:

--with-plugin :kaocha-retry.plugin/retry

You can also configure the number of retries and the wait interval between runs with:

--max-retries $NUMBER_OF_RETRIES

and:

--retry-interval $RETRY_INTERVAL_IN_MILLISECONDS

If you want to narrow down the list of tests that should be actually retried, you can add this configuration in your tests.edn:

:kaocha-retry.plugin/retrying-tests-regexes ["ns/test-*"]

Which is a list of regular expressions that will match both the namespace and the actual test name.

Sample report

After all the tests run you will get a report of the tests that were retried, for example:

4 tests, 5 assertions, 1 errors, 1 failures.
* Tests failed even after 3 retries
- :simple-test/not-working-test
* Tests succeeded after retrying `n` times
- :simple-test/not-working-test-2: 2

Contributing

If you want to try this plugin out just run the kaocha script in that simple project. It will uses kaocha-retry from your local checkout so you can develop with it easily.

kaocha-retry's People

Contributors

andreacrotti avatar wbeard avatar

Stargazers

Vic avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.