summaryrefslogtreecommitdiff
path: root/qa/qa
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2018-10-08 14:56:32 -0400
committerMark Lapierre <mlapierre@gitlab.com>2018-10-08 15:04:08 -0400
commit03ee488f93d4ccce5bb6d476ad33e210fb94a56b (patch)
tree5a0433cb173a90352b778f8787a8c44faac134b5 /qa/qa
parent1540d51a54f6c2e63335824deb93dad75aba1aec (diff)
downloadgitlab-ce-03ee488f93d4ccce5bb6d476ad33e210fb94a56b.tar.gz
Allow the registration e2e test to be skipped
If SIGNUP_DISABLED is true skip any tests with a context :skip_signup_disabled. The context is set for the registration tests. This allows the tests to be skipped when run on the staging, which doesn't allow registration
Diffstat (limited to 'qa/qa')
-rw-r--r--qa/qa/runtime/env.rb14
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb4
-rw-r--r--qa/qa/specs/runner.rb2
3 files changed, 17 insertions, 3 deletions
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 27ba915961d..5bebb5ccec0 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -5,13 +5,17 @@ module QA
# set to 'false' to have Chrome run visibly instead of headless
def chrome_headless?
- (ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i) != 0
+ enabled?(ENV['CHROME_HEADLESS'])
end
def running_in_ci?
ENV['CI'] || ENV['CI_SERVER']
end
+ def signup_disabled?
+ enabled?(ENV['SIGNUP_DISABLED'], default: false)
+ end
+
# specifies token that can be used for the api
def personal_access_token
ENV['PERSONAL_ACCESS_TOKEN']
@@ -83,6 +87,14 @@ module QA
raise ArgumentError, "Please provide GITHUB_ACCESS_TOKEN"
end
+
+ private
+
+ def enabled?(value, default: true)
+ return default if value.nil?
+
+ (value =~ /^(false|no|0)$/i) != 0
+ end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
index 478a5cb9c4c..bc1c2abdf56 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb
@@ -16,13 +16,13 @@ module QA
end
end
- context :manage do
+ context :manage, :skip_signup_disabled do
describe 'standard' do
it_behaves_like 'registration and login'
end
end
- context :manage, :orchestrated, :ldap do
+ context :manage, :orchestrated, :ldap, :skip_signup_disabled do
describe 'while LDAP is enabled' do
it_behaves_like 'registration and login'
end
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index fea0ef94df3..ad397c13f0c 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -23,6 +23,8 @@ module QA
args.push(%w[--tag ~orchestrated]) unless (%w[-t --tag] & options).any?
end
+ args.push(%w[--tag ~skip_signup_disabled]) if QA::Runtime::Env.signup_disabled?
+
args.push(options)
args.push(DEFAULT_TEST_PATH_ARGS) unless options.any? { |opt| opt =~ %r{/features/} }