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:
authorSanad Liaquat <sliaquat@gitlab.com>2018-12-10 16:30:55 +0300
committerSanad Liaquat <sliaquat@gitlab.com>2018-12-10 16:30:55 +0300
commit355aa02dc7c930e3c2414c652b3dea8cd9959d54 (patch)
tree004b910475015dfeb0ac3deab7586dd831455089
parentf6d8fb6e46c5b966c04647d826ef43c018c5303b (diff)
parent15fecbc40931b51e75cdc0deb690727981c6e5c5 (diff)
Merge branch 'qa-reuse-chrome-profile' into 'master'
Add QA option to use the same Chrome profile Closes #52255 See merge request gitlab-org/gitlab-ce!23576
-rw-r--r--qa/qa/runtime/browser.rb7
-rw-r--r--qa/qa/runtime/env.rb5
2 files changed, 12 insertions, 0 deletions
diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb
index 7fd2ba25527..b706d6565d2 100644
--- a/qa/qa/runtime/browser.rb
+++ b/qa/qa/runtime/browser.rb
@@ -70,6 +70,13 @@ module QA
options.add_argument("disable-gpu")
end
+ # Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
+ # Useful to speed up local QA.
+ if QA::Runtime::Env.reuse_chrome_profile?
+ qa_profile_dir = ::File.expand_path('../../tmp/qa-profile', __dir__)
+ options.add_argument("user-data-dir=#{qa_profile_dir}")
+ end
+
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab-ee/issues/4252
options.add_argument("disable-dev-shm-usage") if QA::Runtime::Env.running_in_ci?
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 3bc2b44ccd8..dae5aa3f794 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -30,6 +30,11 @@ module QA
enabled?(ENV['CHROME_HEADLESS'])
end
+ # set to 'true' to have Chrome use a fixed profile directory
+ def reuse_chrome_profile?
+ enabled?(ENV['CHROME_REUSE_PROFILE'], default: false)
+ end
+
def accept_insecure_certs?
enabled?(ENV['ACCEPT_INSECURE_CERTS'])
end