From 4f452f0205f1699dd1ff194b5792eb1a7b3f2847 Mon Sep 17 00:00:00 2001 From: romanrizzi <rizziromanalejandro@gmail.com> Date: Fri, 25 Oct 2019 10:52:23 -0300 Subject: [PATCH] DEV: Add variable to warmup tmp folder and obtain accurate results when profiling specs --- script/docker_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/docker_test.rb b/script/docker_test.rb index 445901b8517..4c72bc69165 100644 --- a/script/docker_test.rb +++ b/script/docker_test.rb @@ -6,6 +6,7 @@ # => COMMIT_HASH used by the discourse_test docker image to load a specific commit of discourse # this can also be set to a branch, e.g. "origin/tests-passed" # => RUN_SMOKE_TESTS executes the smoke tests instead of the regular tests from docker.rake +# => WARMUP_TMP_FOLDER runs a single spec to warmup the tmp folder and obtain accurate results when profiling specs. # See lib/tasks/docker.rake and lib/tasks/smoke_test.rake for more information puts "travis_fold:end:starting_docker_container" if ENV["TRAVIS"] @@ -39,6 +40,10 @@ unless ENV['NO_UPDATE'] puts "travis_fold:end:bundle" if ENV["TRAVIS"] end +if ENV['WARMPUP_TMP_FOLDER'] + run_or_fail('bundle exec rspec ./spec/requests/users_controller_spec.rb:222') +end + log("Running tests") if ENV['RUN_SMOKE_TESTS'] run_or_fail("bundle exec rake smoke:test")