Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Report files are removed between test suites during "rake test" #2

kigster opened this Issue · 7 comments

2 participants


Not sure if there is a better way to discuss this, but I am trying to use minitest-ci to generate XML files for Jenkins to consume.

We have a brand new Rails 3.2.3 application and Ruby 1.9.3 and minitest.

When I run "rake test", it actually runs 3 types of tests in our application: models, controllers and integration. It looks like minitest-ci is generating report files, but cleaning them right before moving on to the next set of tests. I was able to get around this by manually adding a cleanup hook to the "test" task, and adding the following to my minitest_helper.rb:

if ENV['CI']
  require 'minitest/ci'
  # stop CI reporter from cleaning generated files for each suite
  module MiniTest
    module Ci
      def clean; end

I wonder if there is a better way?


Thanks for reporting this. Github is perfect for issues. I'll take a look as soon as I can and get back to you. Patches are always welcome :)

@bhenderson bhenderson was assigned

ok, I can't decide. Usually I recommend running all tests together under one ruby process (then clean is only called once). However, I'm starting to wonder if it should never clean and just let everyone implement their own rake task or something. What do you think?

by the way, you did help me catch another bug thanks!


Thanks for looking into this!

Here is what I propose:

  • keep the default behavior as it currently is for backward compatibility
  • add a global configuration flag that can be set (eg in minitest_helper.rb) to turn off automatic cleanup (eg, MiniTest::Ci.auto_clean = false)
  • expose cleanup functionality via a public rake task and/or public method, so those who want to customize cleanup timing can just call it whenever it's convenient for them.


@bhenderson bhenderson referenced this issue from a commit
bhenderson Adds ability to disable cleaning report dir. #2 0353fe5

how's that?


Looks great! Thanks so much for that.

If I was neatpicky I would still prefer to call "disable_clean" variable "auto_clean", because in the current setup even if I set "disable_clean = true", I can still clean manually (in fact I am expected to). So it's not really disabling cleaning, just not automatically cleaning after each run. But like I said, that's just being neat picky :D

@bhenderson bhenderson referenced this issue from a commit
bhenderson Changes clean switch to positive accessor. #2 cccef9a

whew, finally got around to pushing this. thanks again!


Awesome thanks! Reviewed :D

@bhenderson bhenderson closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.