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

Add a fallback from 'test:prepare' #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MixmasterFresh
Copy link

These changes fix an issue with rails-perftest as mentioned in issue #24. It checks to see if there is a rake task for 'test:prepare', and if there is it will continue as it would normally. Otherwise it falls back to the 'db:test:prepare' rake task. This passes all of the tests (which need to be improved) and I tested it on a few rails apps, and it worked just fine. Resolves #24.

@senny
Copy link
Member

senny commented Oct 13, 2015

@TheAustinSeven can you squash your commits?

@MixmasterFresh
Copy link
Author

The commits have been squashed. Good catch.

@MixmasterFresh
Copy link
Author

This should be passing, the error seems to not be with the code itself but rather with running bundle install. If it were rerun, it would likely pass.

t.pattern = 'test/performance/**/*_test.rb'
end
else
Rails::SubTestTask.new(benchmark: ['db:test:prepare', 'test:perftest:benchmark_mode']) do |t|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the db:test:prepare dependency? In newer versions of Rails the test database in maintained when running a test. This is ensured by the method ActiveRecord::Migration.maintain_test_schema! in test_help.rb. Since test_help.rb is required by the generated test_helper.rb it's always triggered when running a test.

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 this pull request may close these issues.

Is there a way to avoid executing test:prepare?
2 participants