Skip to content

Pin minitest below 6#111

Merged
JuanVqz merged 1 commit into
mainfrom
feature/pin-minitest-below-6
Jun 25, 2026
Merged

Pin minitest below 6#111
JuanVqz merged 1 commit into
mainfrom
feature/pin-minitest-below-6

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Jun 25, 2026

Copy link
Copy Markdown
Member

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 was run_one_method, while 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)
  railties-8.0.2/lib/rails/test_unit/line_filtering.rb:7:in 'run'

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 our rails ~> 8.0.2 pin 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 test job 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 lock keeps minitest at 5.25.5.
  • Full test suite: 33 runs, 101 assertions, 0 failures, 0 errors.

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
JuanVqz force-pushed the feature/pin-minitest-below-6 branch from 17fd0c8 to 8931582 Compare June 25, 2026 19:09
@JuanVqz
JuanVqz merged commit c8e84f8 into main Jun 25, 2026
4 checks passed
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.

1 participant