8000 GitHub - pauldub/minitest-rerun-failed
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pauldub/minitest-rerun-failed

Repository files navigation

Minitest Rerun

Track and rerun failed Minitest tests with ease. Never manually hunt for failing tests again!

Features

  • 🎯 Failure Tracking: Automatically tracks failing tests
  • 🔄 Selective Reruns: Run only the tests that failed in the previous run
  • 🛤️ Rails Integration: Rake tasks for Rails projects
  • 🚀 Simple CLI: Basic command-line interface

Installation

Add this line to your application's Gemfile:

gem 'minitest-rerun', group: :test

And then execute:

$ bundle install

Rails Projects

For Rails projects, the gem automatically provides rake tasks.

Usage

CLI Commands

Run tests with failure tracking

$ minitest-rerun-failed exec
$ minitest-rerun-failed exec "test/models/**/*_test.rb"  # Custom pattern

Rerun only failed tests

$ minitest-rerun-failed rerun

List currently failing tests

$ minitest-rerun-failed failed

Clear failure history

$ minitest-rerun-failed clear

Rails Integration

The gem automatically integrates with Rails. When you run rails test, failures are automatically tracked.

You also get additional rake tasks:

$ rails test              # Automatically tracks failures
$ rake test:rerun_track   # Run tests with failure tracking  
$ rake test:rerun         # Rerun failed tests
$ rake test:rerun_failed  # List failing tests
$ rake test:rerun_clear   # Clear failure history

Workflow Example

Here's a typical development workflow:

# 1. Run your test suite
$ minitest-rerun-failed exec

# Tests run, some fail...

# 2. Fix the failing tests
$ vim test/models/user_test.rb

# 3. Run only the tests that failed
$ minitest-rerun-failed rerun

# 4. Run the full suite to make sure nothing broke
$ minitest-rerun-failed exec

Configuration

The gem supports basic configuration:

MinitestRerunFailed.configure do |config|
  config.track_failures = true
  config.failure_file = ".minitest-failures.json"
  config.pattern = "test/**/*_test.rb"
end

Configuration Options

Option Default Description
track_failures true Automatically track test failures
failure_file .minitest-failures.json File to store failure data
pattern test/**/*_test.rb Test file pattern

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0