CircleCI, Rails 5, Minitest, and avoiding the OptionParser::InvalidOption exception

By | January 3, 2017

After updating a project to rails 5 I was no longer able to use the minitest-ci gem without making a few changes. My project was failing with the following exception:

/home/ubuntu/ebth-com/vendor/bundle/ruby/2.2.0/gems/railties-5.0.1/lib/rails/test_unit/minitest_plugin.rb:57:in `plugin_rails_options': invalid option: --ci-dir=/tmp/circle-junit.pSCJhIM/minitest (OptionParser::InvalidOption)

To fix I basically had to override the test command so –ci-dir wouldn’t be specified. Here is the process as if you hadn’t even set up minitest-ci before:

1. Add minitest-ci to your Gemfile.
2. Run bundle
3. Add the following to your test_helper.rb:

4. Edit your circle.yml and set up this test override:

Leave a Reply

Your email address will not be published. Required fields are marked *