Pin minitest below 6#111
Merged
Merged
Conversation
minitest 6 restructured its runner: the per-method runner is now
Minitest::Runnable.run(klass, method_name, reporter) (3 args), whereas in
minitest 5 that was run_one_method and run(reporter, options) was the
suite-level runner (2 args).
Rails 8.0.2's Rails::LineFiltering#run(reporter, options = {}) override was
written against the old 2-arg shape. Under minitest 6, run_suite calls
run(self, method_name, reporter), hitting that 1..2-arity override and
raising 'ArgumentError: wrong number of arguments (given 3, expected 1..2)'
on boot, before any test runs.
The real fix lives in railties' line_filtering.rb, so adopting minitest 6
requires a Rails release that supports it (8.1+), which is beyond our
'rails ~> 8.0.2' pin and belongs in a dedicated Rails upgrade. Until then,
pin < 6 so Dependabot re-resolutions stop pulling minitest 6 and failing CI
across every batch of dependency PRs.
JuanVqz
force-pushed
the
feature/pin-minitest-below-6
branch
from
June 25, 2026 19:09
17fd0c8 to
8931582
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pin
minitest < 6. minitest 6 is incompatible with Rails 8.0.2's test runner and breaks the suite on boot.Root cause
minitest 6 restructured its runner. The per-method runner is now
Minitest::Runnable.run(klass, method_name, reporter)(3 args) — in minitest 5 that wasrun_one_method, whilerun(reporter, options)was the suite-level runner (2 args).Rails 8.0.2's
Rails::LineFiltering#run(reporter, options = {})override was written against the old 2-arg shape. Under minitest 6,run_suitecallsrun(self, method_name, reporter), hitting that 1..2-arity override and raising:before any test runs.
Why pin instead of fix forward
The fix lives in railties'
line_filtering.rb, not our app. Adopting minitest 6 requires a Rails release that supports it (8.1+), which is beyond ourrails ~> 8.0.2pin and belongs in a dedicated Rails upgrade. A standalone app-side monkeypatch would mean re-implementing line filtering against minitest 6 internals — fragile and not worth it.Impact
Without this pin, Dependabot re-resolutions keep pulling minitest 6.0.6 and red-flagging the
testjob across every batch of dependency PRs (4 open PRs are currently red for exactly this reason). Pinning makes the "upgrade to latest compatible" strategy safe.Follow-up
Revisit minitest 6 as part of a future Rails 8.1 upgrade, then drop this pin.
Verification
bundle lockkeeps minitest at 5.25.5.