Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-01-29 04:45:03 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-01-29 04:56:49 +0300
commitbbe0fa91d01fb9bc70d54e07ee393e857d92a267 (patch)
tree28a17f7488b87ff7aae0d91b1aca1a0834c51184 /spec/support/capybara.rb
parent2b1ddb0f807b328aae00b1d9b0fb7f62e8adbe59 (diff)
Prevent transient Capybara timeouts during feature tests
The problem occurred because asset compilation takes a long time, so when the asset cache didn't exist and the first test ran, it would often (randomly) time out during the generation before the actual test even had a chance to run. Now we check if the cache exists before the suite runs, and if not, we manually fire a request to the root URL in order to generate it. This should allow subsequent tests to use the cached assets.
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index fed1ab6ee33..a698f484df1 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -19,3 +19,9 @@ unless ENV['CI'] || ENV['CI_SERVER']
# Keep only the screenshots generated from the last failing test suite
Capybara::Screenshot.prune_strategy = :keep_last_run
end
+
+RSpec.configure do |config|
+ config.before(:suite) do
+ TestEnv.warm_asset_cache
+ end
+end