This project is archived and is in readonly mode.
Fresh Rails 3 app cannot run performance tests
-
Chris Griego
- Tag changed from actioncontroller, actiondispatch, bundler, generators, performance_test to actioncontroller, actiondispatch, bug, bundler, generators, performance_test
-
GitHub
I'm happy to put together a patch, but I need some guidance on the best changes to make.
-
Chris Griego
I'm happy to put together a patch, but I need some guidance on the best changes to make.
Sorry, wrong account above.
-
Jeremy Kemper
- State changed from new to open
- Assigned user set to Jeremy Kemper
+1 on all four points, Chris.
For ruby-prof, I think a lazy-require would be good enough. If it's not available at that time, raise an error asking to add it to the Gemfile in the :test group.
-
Rizwan Reza
- State changed from open to resolved
(from [835f5d0269a8d3615585119e77f1ba7d601c943b]) Rails 3 application can run performance tests now. [#4171 Fresh Rails 3 app cannot run performance tests state:resolved] http://github.com/rails/rails/commit/835f5d0269a8d3615585119e77f1ba...
-
chaitanyav
- Importance changed from to High
Rizwan, this ticket still shsows as new in the list. Can this be updated to show resolved
-
Andreas Haller
I think this is still an issue.
Trying to run the performance test with a fresh Rails app after adding "ruby-prof" to the Gemfile, i get this error:activesupport-3.0.0/lib/active_support/testing/performance.rb:39:in `run': uninitialized constant BrowsingTest::STARTED (NameError)Here's the full trace:
fresh$ rake test:benchmark --trace (in /Users/andreashaller/Desktop/fresh) ** Invoke test:benchmark (first_time) ** Invoke test:prepare (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations ** Execute db:test:prepare ** Invoke db:test:load (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:load ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute test:prepare ** Execute test:benchmark Loaded suite /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader Started /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/testing/performance.rb:39:in `run': uninitialized constant BrowsingTest::STARTED (NameError) from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:641:in `block (2 levels) in run_test_suites' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:635:in `each' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:635:in `block in run_test_suites' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:634:in `each' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:634:in `run_test_suites' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:594:in `run' from /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:492:in `block in autorun' rake aborted! Command failed with status (1): [/Users/andreashaller/.rvm/rubies/ruby-1.9....] /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:995:in `block in sh' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1010:in `call' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1010:in `sh' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1094:in `sh' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1029:in `ruby' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1094:in `ruby' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/test_unit/testing.rake:26:in `block (2 levels) in define' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/test_unit/testing.rake:11:in `block in define' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `call' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `each' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain' /Users/andreashaller/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in `<top (required)>' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load' /Users/andreashaller/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>' -
MikZ
Same problem here. Fails in
activesupport-3.0.0/lib/active_support/testing/performance.rb:39Fresh Rails3 install, installed ruby-prof and added to Gemfile.
-
MikZ
Using Ruby 1.9.2 and ruby-pref 0.9.2
-
MikZ
It's probably problem with Ruby 1.9.2. I've created new issue:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets... -
jnimety
lib/active_support/testing/performance.rb and ruby-prof rely on Test::Unit, adding "gem 'test-unit'" to my Gemfile allows me to run test:profile and test:benchmark on 1.9.2 without the "uninitialized constant BrowsingTest::STARTED" exception. I'd also advise compiling ruby 1.9.2 with the gcdata patch to get the most out of the test:benchmark results (this is not the patch referenced at http://guides.rubyonrails.org/performance_testing.html#installing-g.... The gcdata patch is included with rvm but I'm not sure where the official version resides.