Flakon
Smart flaky tests detection for Rails apps.
Installation
Add gem to your project:
# Gemfile
gem "flakon", group: :test
Supported Ruby versions
- Ruby (MRI) >= 2.5.0
Usage
Make sure flakon is loaded:
- Happens automatically when you load a Rails app unless you added
require: falsein the Gemfile). - Add
require 'flakon'in yourrails_helper.rb/test_helper.rb.
To enable flaky tests analysis, run tests with FLAKON=1 env var set:
FLAKON=1 bundle exec rspec
# or
FLAKON=1 bundle exec rails test
When flakiness is detected, the test is marked as failed with the thourough description on what has happened and how to fix this.
NOTE: The tests could take a bit longer to execute than usually, since Flakon tries to re-run some of them to detect problems.
NOTE: Flakon requires running tests in a random order. Otherwise an exception is raised and the execution halts.
Analyzers
TBD
License
The gem is available as open source under the terms of the MIT License.