Skip to content

add compatibility for minitest 6#407

Open
catwomey wants to merge 1 commit intomainfrom
ct/minitest-6-compatibility
Open

add compatibility for minitest 6#407
catwomey wants to merge 1 commit intomainfrom
ct/minitest-6-compatibility

Conversation

@catwomey
Copy link
Copy Markdown

minitest 6.0 shipped breaking API changes that affect ci-queue. This PR adds minitest 6 support while remaining backwards compatible with minitest 5.11+.

Breaking changes in minitest 6

1. Minitest.run_one_method(klass, name) — removed

ci-queue used this to run individual tests in SingleExample#run and LazySingleExample#run. Replaced with klass.new(name).run which works on both minitest 5 and 6.

2. Minitest.__run — renamed to Minitest.run_all_suites

ci-queue prepends a module onto Minitest's singleton class to override __run with its Redis-backed poll loop. minitest 6 renamed this method, so the override no longer fires. We now define both __run and run_all_suites on the prepended module — only the one matching the active minitest version is called;
the other is inert.

3. Plugin loading — now opt-in

minitest 5 auto-discovered plugins via load_plugins inside Minitest.run. minitest 6 removed this. Without it, minitest-reporters' plugin_minitest_reporter_init never fires, so its DelegateReporter is never created. This meant ci-queue's reporters (including BuildStatusRecorder) were set in
Minitest::Reporters.reporters but never wired into the CompositeReporter that Minitest.run actually calls record on.

The consequence: BuildStatusRecorder#record never ran → acknowledge never called → Redis running set never cleared → exhausted? never returned true → the poll loop hung forever.

Fixed by calling Minitest.load_plugins explicitly when ci-queue sets up its reporters, and in run_tests_in_fork (used by bisect).

4. Parallel::Executor thread pool

minitest 6 starts N threads (where N = CPU count) before run_all_suites and joins them afterward via shutdown. ci-queue bypasses the executor entirely — it has its own Redis poll loop — so those threads sit idle on queue.pop and shutdown blocks forever. We now drain the executor after Queue.run
completes.

Backwards compatibility

All changes are guarded by respond_to? checks. No version string comparisons. minitest 5.11+ continues to work unchanged.

Comment thread ruby/Gemfile.lock
@catwomey catwomey force-pushed the ct/minitest-6-compatibility branch from 6f348d3 to fb167a2 Compare May 1, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants