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

Don't know how to build task 'test:benchmark' #26

Closed
sirius248 opened this issue Oct 23, 2015 · 9 comments
Closed

Don't know how to build task 'test:benchmark' #26

sirius248 opened this issue Oct 23, 2015 · 9 comments

Comments

@sirius248
Copy link

rake test:benchmark is not available for Rails >= 4.1.7. Not sure anyone got chance to fix it yet?

@MixmasterFresh
Copy link

there is currently a PR in review that fixes this. #25

@sirius248
Copy link
Author

@TheAustinSeven thanks! however your solution seem doesn't work.

@MixmasterFresh
Copy link

That is strange. It worked perfectly fine when I tested it. If you are talking about the CI failure, that is not due to the code I wrote, but an error with the CI itself. Could you clarify how it doesn't work?

@senny
Copy link
Member

senny commented Oct 24, 2015

@kimquy can you please post the complete backtrace of your error?

@sirius248
Copy link
Author

@senny

$ bundle exec rake test:benchmark --trace
rake aborted!
Don't know how to build task 'test:benchmark'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:149:in `invoke_task'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/Users/dev/Desktop/squar/squar-server/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'

@senny
Copy link
Member

senny commented Oct 25, 2015

Did you add gem 'rails-perftest' only in the :test group? For the rake tasks to be available it needs to be loaded outside the test context as well.

@sirius248
Copy link
Author

My Gemfile. Couple of people suggest include the following gem 'test-unit'. But also doesn't work. Not sure what I am missing here.

....
gem 'rake', '10.4.2'
...
group :test do
  gem 'factory_girl_rails'
  gem 'shoulda-matchers', require: false
  gem 'capybara', require: false
  gem 'simplecov', '~> 0.9', require: false
  gem 'test_after_commit'
  gem 'rails-perftest'
  gem 'ruby-prof'
end

@MixmasterFresh
Copy link

You will have to move gem 'rails-perftest' outside of the group :test block

@sirius248
Copy link
Author

@TheAustinSeven worked! Not even sure why I didn't try to put it outside of group :test Thanks!

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

No branches or pull requests

3 participants