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

Is there a way to avoid executing test:prepare? #24

Open
viccarrasco opened this issue Sep 22, 2015 · 2 comments · May be fixed by #25
Open

Is there a way to avoid executing test:prepare? #24

viccarrasco opened this issue Sep 22, 2015 · 2 comments · May be fixed by #25

Comments

@viccarrasco
Copy link

I need to test the performance of my website with real data, I wont spend the time creating millions of fixture records to do this, so is there a way to test my application with a copy of my production data without having it replaced by fixtures? I've tried creating a new benchmark environment for my rails app with numerous tutorials and none have worked. Is there a way to do this?

@MixmasterFresh
Copy link

I think that it could be a simple change, I'll check it out. As of right now, you can create a rake task for 'test:prepare' so that it doesn't break.

@MixmasterFresh MixmasterFresh linked a pull request Oct 7, 2015 that will close this issue
@sebboh
Copy link

sebboh commented Nov 18, 2015

@Sapherous This might be a little late for you, but I just went through this exercise myself, mostly based on these instructions:
http://tekin.co.uk/2014/09/performance-test-rails-against-real-data/
I'm running rails 4.2.4

I modified the author's rake task to look like this:

# lib/tasks/test_benchmark.rake
# Use this rake task to run performance tests against the "benchmark"
# environment. See test/benchmark_helper.rb for more details.
namespace :test do
  Rake::TestTask.new(:real_world_benchmark => ['test:perftest:benchmark_mode', 'test:real_world_profile']) do |t|
  end

  Rake::TestTask.new(:real_world_profile) do |t|
    t.libs << 'test'
    t.pattern = 'test/performance/**/*_test.rb'
  end
end

Otherwise, most of the other setup worked as is, and I can now run bundle exec rake test:real_world_benchmark against my development database.

One other gotcha I ran into was that I had to add :benchmark to the [:development, :test] group in myGemfileand make sure that rails-perfest and ruby-prof were included.

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 a pull request may close this issue.

3 participants