Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Added minitest plugin #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfazekas
Copy link
Contributor

@mfazekas mfazekas commented Apr 1, 2016

This is more a request for comment than a pull req to merge.

It adds a minitest plugin so we can do stuff like rails test --benchmark to run perf test in benchmark mode.

It adds a minitest plugin that tries to get back the pre rails-4 feature of rake test not running performance tests. In all my projects perf test requires different db than test db, they also took a long time to run. So it's not practical to run them with every rake test.

In rails-4 world i've used a workaround like this:

  namespace :test do
    Rails::TestTask.new(:run) do |t|
      dirs = %w(models controllers integration mailers workers)
      t.test_files = dirs.map { |dir| Dir.glob("test/#{dir}/**/*_test.rb") }.flatten
    end
  end
  Rake::Task['test:run'].actions.shift

In rails 5 world this would be implemented by a minitest plugin. But i'm not sure who want's to run perf test together vs who doesn't. Maybe it should be a different rubygem. Like if you adding 'gem "rails-perftest-separate"' will run not run perftest on rails test run.
Otherwise i assume the rails test --benchmark can be usefull in rails-perftest.

@senny
Copy link
Member

senny commented Aug 8, 2016

I guess most people do want to run perf tests separately. Having everything integrate with MiniTest seems nice as well.

That's just guessing though. I did the extraction from core into this gem but haven't used the functionality much.

I'd be 👍 to merge this. Since @kaspth worked on the test runner as well, maybe he has some insights of his own.

@kaspth
Copy link

kaspth commented Aug 9, 2016

I'm fine with adding this plugin. Though it should be said rails test's support for other plugins could stand to improve: rails/rails#25055. I.e. you shouldn't have to muck with the extension order.

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.

3 participants