Minitest Distributed banner
Shopify Shopify

Minitest Distributed

Development community

Description

minitest-distributed is a plugin for minitest for executing tests on a distributed set of unreliable workers.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

minitest-distributed

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)

[About this repo](#about-this-repo) | [Commands](#commands) | [How to use this repo](#how-to-use-this-repo) | [Contribute to this repo](#contribute-to-this-repo) | [License](#license)

About this repo

**Introduction:**

`minitest-distributed` is a plugin for [minitest](https://github.com/seattlerb/minitest) for executing tests on a distributed set of unreliable workers.

When a test suite grows large enough, it inevitable gets too slow to run on a single machine to give timely feedback to developers. This plugins combats this issue by distributing the full test suite to a set of workers. Every worker is a consuming from a single queue, so the tests get evenly distributed and all workers will finish around the same time. Redis is used as coordinator, but when using this plugin without having access to Redis, it will use an in-memory coordinator.

Using multiple (virtual) machines for a test run is an (additional) source of flakiness. To combat flakiness, minitest-distributed implements resiliency patterns, like re-running a test on a different worker on failure, and a circuit breaker for misbehaving workers.

Commands

**Distributed invocation**

To actually run tests with multiple workers, you have to point every worker to a Redis coordinator, and use the same run identifier.

ruby -Itest --coordinator=redis://localhost/1 --run-id= test/my_test.rb

We recommend using the build number or identifier form your CI system as run identifier, but it will work with any value that is shared between all workers. You can also set these values by setting the `MINITEST_COORDINATOR` and `MINITEST_RUN_ID` environment variables, respectively.

If you are using a Rails project, the Rails test runner (`bin/rails test`) will also support these command line arguments and environment variables.

If you are using a `Rake::TestTask` to invoke your test s