DEV: Add travis_fold statements to docker_test

This commit is contained in:
David Taylor 2018-09-12 16:43:21 +01:00
parent 24c55bd613
commit 26bd67a865
2 changed files with 18 additions and 3 deletions

View File

@ -39,6 +39,7 @@ task 'docker:test' do
begin begin
@good = true @good = true
unless ENV['SKIP_LINT'] unless ENV['SKIP_LINT']
puts "travis_fold:start:lint" if ENV["TRAVIS"]
puts "Running linters/prettyfiers" puts "Running linters/prettyfiers"
puts "eslint #{`yarn eslint -v`}" puts "eslint #{`yarn eslint -v`}"
puts "prettier #{`yarn prettier -v`}" puts "prettier #{`yarn prettier -v`}"
@ -64,9 +65,11 @@ task 'docker:test' do
@good &&= run_or_fail('yarn prettier --list-different "plugins/**/*.scss" "plugins/**/*.es6"') @good &&= run_or_fail('yarn prettier --list-different "plugins/**/*.scss" "plugins/**/*.es6"')
end end
end end
puts "travis_fold:end:lint" if ENV["TRAVIS"]
end end
unless ENV['SKIP_TESTS'] unless ENV['SKIP_TESTS']
puts "travis_fold:start:prepare_tests" if ENV["TRAVIS"]
puts "Cleaning up old test tmp data in tmp/test_data" 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` `rm -fr tmp/test_data && mkdir -p tmp/test_data/redis && mkdir tmp/test_data/pg`
@ -94,8 +97,10 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake db:migrate") @good &&= run_or_fail("bundle exec rake db:migrate")
unless ENV["JS_ONLY"] puts "travis_fold:end:prepare_tests" if ENV["TRAVIS"]
unless ENV["JS_ONLY"]
puts "travis_fold:start:ruby_tests" if ENV["TRAVIS"]
unless ENV["SKIP_CORE"] unless ENV["SKIP_CORE"]
params = [] params = []
if ENV["BISECT"] if ENV["BISECT"]
@ -114,10 +119,11 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake plugin:spec") @good &&= run_or_fail("bundle exec rake plugin:spec")
end end
end end
puts "travis_fold:end:ruby_tests" if ENV["TRAVIS"]
end end
unless ENV["RUBY_ONLY"] unless ENV["RUBY_ONLY"]
puts "travis_fold:start:js_tests" if ENV["TRAVIS"]
unless ENV["SKIP_CORE"] unless ENV["SKIP_CORE"]
@good &&= run_or_fail("bundle exec rake qunit:test['600000']") @good &&= run_or_fail("bundle exec rake qunit:test['600000']")
@good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']") @good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']")
@ -130,7 +136,7 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']") @good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']")
end end
end end
puts "travis_fold:end:js_tests" if ENV["TRAVIS"]
end end
end end

View File

@ -6,6 +6,8 @@
# => RUN_SMOKE_TESTS executes the smoke tests instead of the regular tests from docker.rake # => RUN_SMOKE_TESTS executes the smoke tests instead of the regular tests from docker.rake
# See lib/tasks/docker.rake and lib/tasks/smoke_test.rake for more information # See lib/tasks/docker.rake and lib/tasks/smoke_test.rake for more information
puts "travis_fold:end:starting_docker_container" if ENV["TRAVIS"]
def run_or_fail(command) def run_or_fail(command)
pid = Process.spawn(command) pid = Process.spawn(command)
Process.wait(pid) Process.wait(pid)
@ -13,11 +15,18 @@ def run_or_fail(command)
end end
unless ENV['NO_UPDATE'] unless ENV['NO_UPDATE']
puts "travis_fold:start:pulling_latest_discourse" if ENV["TRAVIS"]
run_or_fail("git pull") run_or_fail("git pull")
checkout = ENV['COMMIT_HASH'] || "HEAD" checkout = ENV['COMMIT_HASH'] || "HEAD"
run_or_fail("git checkout #{checkout}") run_or_fail("git checkout #{checkout}")
puts "travis_fold:end:pulling_latest_discourse" if ENV["TRAVIS"]
puts "travis_fold:start:bundle" if ENV["TRAVIS"]
run_or_fail("bundle") run_or_fail("bundle")
puts "travis_fold:end:bundle" if ENV["TRAVIS"]
end end
if ENV['RUN_SMOKE_TESTS'] if ENV['RUN_SMOKE_TESTS']