Commit f912e3b1 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'jarv/add-qa-cookies' into 'master'

Adds QA_COOKIES option to gitlab-qa

See merge request gitlab-org/gitlab-ce!23416
parents 56da2308 8cfefefa
......@@ -80,6 +80,15 @@ GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sa
All [supported environment variables are here](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/what_tests_can_be_run.md#supported-environment-variables).
### Sending additional cookies
The environment variable `QA_COOKIES` can be set to send additional cookies
on every request. This is necessary on gitlab.com to direct traffic to the
canary fleet. To do this set `QA_COOKIES="gitlab_canary=true"`.
To set multiple cookies, separate them with the `;` character, for example: `QA_COOKIES="cookie1=value;cookie2=value2"`
### Building a Docker image to test
Once you have made changes to the CE/EE repositories, you may want to build a
......
......@@ -117,6 +117,15 @@ def url
def perform(&block)
visit(url)
if QA::Runtime::Env.qa_cookies
browser = Capybara.current_session.driver.browser
QA::Runtime::Env.qa_cookies.each do |cookie|
name, value = cookie.split("=")
value ||= ""
browser.manage.add_cookie name: name, value: value
end
end
yield.tap { clear! } if block_given?
end
......
......@@ -38,6 +38,10 @@ def running_in_ci?
ENV['CI'] || ENV['CI_SERVER']
end
def qa_cookies
ENV['QA_COOKIES'] && ENV['QA_COOKIES'].split(';')
end
def signup_disabled?
enabled?(ENV['SIGNUP_DISABLED'], default: false)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment