-
Notifications
You must be signed in to change notification settings - Fork 58
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,25 @@ namespace :test do | |
task 'perftest:benchmark_mode' do | ||
ENV["BENCHMARK_TESTS"] = '1' | ||
end | ||
if Rake::Task.task_defined?('test:prepare') | ||
Rails::SubTestTask.new(benchmark: ['test:prepare', 'test:perftest:benchmark_mode']) do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
end | ||
|
||
Rails::SubTestTask.new(benchmark: ['test:prepare', 'test:perftest:benchmark_mode']) do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
end | ||
Rails::SubTestTask.new(profile: 'test:prepare') do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
end | ||
else | ||
Rails::SubTestTask.new(benchmark: ['db:test:prepare', 'test:perftest:benchmark_mode']) do |t| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need the |
||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
end | ||
|
||
Rails::SubTestTask.new(profile: 'test:prepare') do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
Rails::SubTestTask.new(profile: 'db:test:prepare') do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/performance/**/*_test.rb' | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the
if
statement be used to just determine the tasks dependencies? This would get us around copying everything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we still have the fallback to db:test:prepare or is there something that you would prefer instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the
db:test:prepare
dependency is necessary. It's executed on demand whentest_help.rb
is loaded.