could not run performance test #4938

Closed
joneslee85 opened this Issue Feb 8, 2012 · 18 comments

Comments

Projects
None yet
@joneslee85
Contributor

joneslee85 commented Feb 8, 2012

$ 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'
@jasonnoble

This comment has been minimized.

Show comment
Hide comment
@jasonnoble

jasonnoble Feb 25, 2012

Contributor

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:inmap!'
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:innon_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:inrun'
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:inrun_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$

Contributor

jasonnoble commented Feb 25, 2012

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:inmap!'
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:innon_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:inrun'
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:inrun_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$

@jasonnoble

This comment has been minimized.

Show comment
Hide comment
@jasonnoble

jasonnoble Feb 25, 2012

Contributor
@seanmoon

This comment has been minimized.

Show comment
Hide comment
@seanmoon

seanmoon Mar 13, 2012

having same issue on rails 3.2.0 and 1.9.3-p0

having same issue on rails 3.2.0 and 1.9.3-p0

@carlosantoniodasilva

This comment has been minimized.

Show comment
Hide comment
@carlosantoniodasilva

carlosantoniodasilva Apr 27, 2012

Member

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.

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.

@sriedel

This comment has been minimized.

Show comment
Hide comment
@sriedel

sriedel Apr 28, 2012

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.

sriedel commented Apr 28, 2012

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.

@jmstacey

This comment has been minimized.

Show comment
Hide comment
@jmstacey

jmstacey Jun 6, 2012

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...

jmstacey commented Jun 6, 2012

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...

@jasperkennis

This comment has been minimized.

Show comment
Hide comment
@jasperkennis

jasperkennis Jun 21, 2012

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

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

@dreki

This comment has been minimized.

Show comment
Hide comment
@dreki

dreki Jul 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

dreki commented Jul 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
@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Aug 18, 2012

Member

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

Member

schneems commented Aug 18, 2012

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

@carlosantoniodasilva

This comment has been minimized.

Show comment
Hide comment
@carlosantoniodasilva

carlosantoniodasilva Aug 18, 2012

Member

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.

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.

route added a commit to route/rails that referenced this issue Sep 8, 2012

#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.
@parndt

This comment has been minimized.

Show comment
Hide comment
@parndt

parndt Jan 28, 2013

Contributor

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

Contributor

parndt commented Jan 28, 2013

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

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Jan 29, 2013

Member

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

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

Member

steveklabnik commented Jan 29, 2013

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

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

@teamon

This comment has been minimized.

Show comment
Hide comment
@teamon

teamon Mar 6, 2013

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

teamon commented Mar 6, 2013

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

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 6, 2013

Member

@teamon, Y U NO submit documentation pull request?

Member

schneems commented Mar 6, 2013

@teamon, Y U NO submit documentation pull request?

@teamon

This comment has been minimized.

Show comment
Hide comment
@teamon

teamon Mar 6, 2013

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

teamon commented Mar 6, 2013

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

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Mar 6, 2013

Member

@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.

Member

steveklabnik commented Mar 6, 2013

@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.

@teamon

This comment has been minimized.

Show comment
Hide comment
@teamon

teamon Mar 6, 2013

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

teamon commented Mar 6, 2013

@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