From 3ac927046008bf8faa8913dcb0150ded16b9bccd Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 22 Nov 2018 14:47:08 +0000 Subject: More env vars for group & project names in QA This will help with https://gitlab.com/gitlab-org/gitlab-qa/issues/349 as we need to use much shorter project and group names for HTTPS to work --- qa/qa/runtime/env.rb | 8 ++++++++ qa/qa/runtime/namespace.rb | 2 +- .../auto_devops/create_project_with_auto_devops_spec.rb | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 1154eaca6a9..0d573859238 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -103,6 +103,14 @@ module QA ENV['GITLAB_SANDBOX_NAME'] end + def namespace_name + ENV['GITLAB_NAMESPACE_NAME'] + end + + def auto_devops_project_name + ENV['GITLAB_AUTO_DEVOPS_PROJECT_NAME'] + end + def gcloud_account_key ENV.fetch("GCLOUD_ACCOUNT_KEY") end diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index f1c8ef11f94..704c65467e0 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -8,7 +8,7 @@ module QA end def name - "qa-test-#{time.strftime('%Y-%m-%d-%H-%M-%S')}" + Runtime::Env.namespace_name || "qa-test-#{time.strftime('%Y-%m-%d-%H-%M-%S')}" end def path diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index 30ec0665973..b0c277a48c3 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -16,7 +16,7 @@ module QA Page::Main::Login.act { sign_in_using_credentials } project = Resource::Project.fabricate! do |p| - p.name = 'project-with-autodevops' + p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops' p.description = 'Project with Auto Devops' end -- cgit v1.2.1