Summary
Rake 13.4.0/13.4.1 overwrites ENV["TESTOPTS"] instead of appending to it, breaking ci_reporter_minitest and any other tools that use TESTOPTS.
Reproduction
Gemfile:
gem'rake','13.4.1'gem'minitest','~> 5.18'gem'ci_reporter_minitest','~> 1.0.0'
Rakefile:
require'rake/testtask'require'ci/reporter/rake/minitest'Rake::TestTask.new(:test)do |t|
t.test_files=FileList['test/**/*_test.rb']t.verbose=true# Triggers the bugend
Run:bundle exec rake ci:setup:minitest test
Expected vs Actual
| Rake Version | Run Options | XML Reports |
|---|
| 13.3.1 ✅ | --ci-reporter --seed 12145 | Generated |
| 13.4.1 ❌ | -v --seed 17890 | Missing |
Root Cause
PR #394 (commit be030da) added this to lib/rake/file_utils_ext.rb:
ENV["TESTOPTS"]="-v"ifvalue# Overwrites existing value!
When ci:setup:minitest sets ENV["TESTOPTS"] = "--ci-reporter", then TestTask calls FileUtilsExt.verbose(true), it destroys the --ci-reporter flag.
Fix
Change line in lib/rake/file_utils_ext.rb:
# Before (broken):ENV["TESTOPTS"]="-v"ifvalue# After (fixed):ENV["TESTOPTS"]=[ENV["TESTOPTS"],"-v"].compact.join(" ")ifvalueImpact
- Production CI failing since April 14, 2026 (13.4.0 release)
- Affects Foreman project: working build vs broken build
- Any project using
ci_reporter_minitest or custom TESTOPTS
Workaround
Summary
Rake 13.4.0/13.4.1 overwrites
ENV["TESTOPTS"]instead of appending to it, breakingci_reporter_minitestand any other tools that useTESTOPTS.Reproduction
Gemfile:
Rakefile:
Run:
bundle exec rake ci:setup:minitest testExpected vs Actual
--ci-reporter --seed 12145-v --seed 17890Root Cause
PR #394 (commit be030da) added this to
lib/rake/file_utils_ext.rb:When
ci:setup:minitestsetsENV["TESTOPTS"] = "--ci-reporter", then TestTask callsFileUtilsExt.verbose(true), it destroys the--ci-reporterflag.Fix
Change line in
lib/rake/file_utils_ext.rb:Impact
ci_reporter_minitestor customTESTOPTSWorkaround