Skip to content
This repository

could not run performance test #4938

Closed
joneslee85 opened this Issue February 07, 2012 · 18 comments
Trung Lê
$ rails new demo
$ cd demo
$ rake db:migrate
$ echo "gem 'ruby-prof'" >> Gemfile
$ bundle install
$ rake test:benchmark
/Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: --benchmark (ArgumentError)
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    from /Users/macbookair/.rvm/rubies/ruby-1.9.3-p0-perf/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
Jason Noble

Confirmed with 1.9.3-p125 and rails 3.2.2.rc1.

jasonn@ruby-rules:~/source/issue_4938$ rake test:benchmark
/Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:167:in block in non_options': file not found: --benchmark (ArgumentError)
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:146:in
map!'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:146:in non_options'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:207:in
non_options'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:52:in process_args'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/minitest/unit.rb:891:in
_run'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/minitest/unit.rb:884:in run'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:21:in
run'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:326:in block (2 levels) in autorun'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:27:in
run_once'
from /Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
rake aborted!
Command failed with status (1): [/Users/jasonn/.rvm/rubies/ruby-1.9.3-p125/...]

Tasks: TOP => test:benchmark
(See full trace by running task with --trace)
jasonn@ruby-rules:~/source/issue_4938$

Sean Moon

having same issue on rails 3.2.0 and 1.9.3-p0

Carlos Antonio da Silva

I was able to reproduce this issue some time ago, but didn't have time to look at it again. I'll give it a try in the following days. Thanks.

Sven Riedel

Looks like the --benchmark option in railsties-3.2.x/lib/rails/test_unit/testing.rake:129 is test_unit dependent and doesn't work with minitest. After I added test-unit to my test group in the Gemfile, this exact problem went away. (Rails 3.2.2, Ruby 1.9.3-p0, Test::Unit 2.4.8)

Caveat: I haven't checked if this has issues with rspec.

Jon Stacey

I was having this same problem and sriedel's solution of adding 'test-unit' fixes the problem, but this should probably work out of the box...

Jasper Kennis

I can confirm adding 'test-unit' fixes this issue in Rails 3.2.6 on Ruby 1.9.3.

Sean Gilbertson
dreki commented July 16, 2012

Worked for me as well. Mac OS X, ruby 1.9.3p194 (installed with homebrew), Rails 3.2.6.

Added these to my Gemfile in :test and :development:

  gem 'ruby-prof',          '~> 0.11.2'  # For profiling
  gem 'test-unit',          '~> 2.5.1'   # For profiling
Richard Schneeman
Collaborator

Last comment 1 month ago. Any chance someone can dig into this issue and fix the root cause? If not we could add 'test-unit' to the docs in addition to 'ruby-prof' http://guides.rubyonrails.org/performance_testing.html#using-ruby-prof-on-mri-and-ree

Carlos Antonio da Silva

I was unable to get back to it, but was able to reproduce. I still have this issue bookmarked to try again when I find some time, but if someone else wants to give it a try, please feel free, I'd be very happy to help as possible.

Dmitry Vorotilin route referenced this issue from a commit August 21, 2012
Commit has since been removed from the repository and is no longer available.
Dmitry Vorotilin route referenced this issue from a commit August 22, 2012
Commit has since been removed from the repository and is no longer available.
Dmitry Vorotilin route referenced this issue from a commit September 06, 2012
Commit has since been removed from the repository and is no longer available.
Dmitry Vorotilin route referenced this issue from a commit in route/rails August 22, 2012
Dmitry Vorotilin #4938 Fix launching performance tests
When we run `rake test:benchmark` for performance tests it raises
ArgumentError that file --benchmark not found. It happens because
gem 'test-unit' passes remaining options to the tests, whereas mintest
doesn't do it.
91d4a58
Philip Arndt

Did this ever get solved? I see on the PR that this stuff was moved to another repo?

Steve Klabnik steveklabnik closed this January 29, 2013
Steve Klabnik
Collaborator

Yes, performance tests were extracted: https://github.com/rails/rails-perftest

If this is still an issue, please open something on that repo.

Tymon Tobolski

@steveklabnik Why there is no single reference to rails-perftest in guides?

Richard Schneeman
Collaborator

@teamon, Y U NO submit documentation pull request?

Tymon Tobolski

I would have to know a working solution for rails 3.x, no luck so far, everything I try is broken.

Steve Klabnik
Collaborator

@teamon as @schneems said, but in a slightly less troll-y way: "because nobody's done it yet."

One of the reasons they were extracted is that they aren't really used by very many people, so that might be why docs are light.

Tymon Tobolski

@steveklabnik Can you point me to any reference about using performance testing/profiler with rails?

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.