Skip to content

Commit

Permalink
update rake setup to not run if test app exists
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlinsley committed Apr 22, 2014
1 parent 0675fb3 commit d97f84b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion script/travis_cache
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end

# Don't use an existing archive if the Gemfile.lock changed
def download_app
s3 :save, file: "#{APP}.sha2", as: "remote-#{APP}.sha2"
s3 :save, file: "#{APP}.sha2", as: "remote-#{APP}.sha2"
if !digest_changed?('Gemfile.lock', "remote-#{BUNDLE}.sha2", "#{BUNDLE}.sha2") &&
!digest_changed?('spec/support', "remote-#{APP}.sha2", "#{APP}.sha2")
s3 :save, file: "#{APP}.tgz", as: "remote-#{APP}.tgz", untar: true
Expand Down
10 changes: 7 additions & 3 deletions tasks/test.rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
desc "Creates a test rails app for the specs to run against"
task :setup do
require 'rails/version'
system("mkdir spec/rails") unless File.exists?("spec/rails")
system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} -m spec/support/rails_template.rb"
Rake::Task['parallel:after_setup_hook'].invoke
if File.exists? dir = "spec/rails/rails-#{Rails::VERSION::STRING}"
puts "test app #{dir} already exists; skipping"
else
system("mkdir spec/rails") unless File.exists?("spec/rails")
system "bundle exec rails new #{dir} -m spec/support/rails_template.rb"
Rake::Task['parallel:after_setup_hook'].invoke
end
end

desc "Run the full suite using 1 core"
Expand Down

0 comments on commit d97f84b

Please sign in to comment.