From 5443734a1f581231b6638bff03b47bb75ddfd1d8 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 20 Jun 2014 09:27:09 +1000 Subject: [PATCH] Refactor: allow running js or ruby tests only --- lib/tasks/docker.rake | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake index 941513eae..430d9d768 100644 --- a/lib/tasks/docker.rake +++ b/lib/tasks/docker.rake @@ -9,14 +9,6 @@ desc 'Run all tests (JS and code in a standalone environment)' task 'docker:test' do begin - unless ENV['NO_UPDATE'] - exit 1 unless run_or_fail("git remote update") - - checkout = ENV['COMMIT_HASH'] || "HEAD" - exit 1 unless run_or_fail("git checkout #{checkout}") - exit 1 unless run_or_fail("bundle") - end - puts "Cleaning up old test tmp data in tmp/test_data" `rm -fr tmp/test_data && mkdir -p tmp/test_data/redis && mkdir tmp/test_data/pg` @@ -31,7 +23,6 @@ task 'docker:test' do `echo full_page_writes = off >> tmp/test_data/pg/postgresql.conf` `echo shared_buffers = 500MB >> tmp/test_data/pg/postgresql.conf` - puts "Starting postgres" @pg_pid = Process.spawn("#{@postgres_bin}postmaster -D tmp/test_data/pg") @@ -39,8 +30,12 @@ task 'docker:test' do ENV["RAILS_ENV"] = "test" @good = run_or_fail("bundle exec rake db:create db:migrate") - @good &&= run_or_fail("bundle exec rspec") - @good &&= run_or_fail("bundle exec rake qunit:test") + unless ENV["JS_ONLY"] + @good &&= run_or_fail("bundle exec rspec") + end + unless ENV["RUBY_ONLY"] + @good &&= run_or_fail("bundle exec rake qunit:test") + end ensure puts "Terminating"