From 133b3f20fc60a9294eede7c4233c5272566e580e Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 8 Feb 2018 22:34:56 +0800 Subject: Allow using a different sandbox group for QA --- qa/README.md | 8 ++++++++ qa/qa/runtime/namespace.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qa/README.md b/qa/README.md index 3c1b61900d9..29720668251 100644 --- a/qa/README.md +++ b/qa/README.md @@ -70,6 +70,14 @@ If you need to authenticate as a different user, you can provide the GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password bin/qa Test::Instance https://gitlab.example.com ``` +If your user doesn't have permission to default sandbox group +`gitlab-qa-sandbox`, you could also use another sandbox group by giving +`GITLAB_SANDBOX_NAME`: + +``` +GITLAB_USERNAME=jsmith GITLAB_PASSWORD=password GITLAB_SANDBOX_NAME=jsmith-qa-sandbox bin/qa Test::Instance https://gitlab.example.com +``` + All [supported environment variables are here](https://gitlab.com/gitlab-org/gitlab-qa#supported-environment-variables). [GDK]: https://gitlab.com/gitlab-org/gitlab-development-kit/ diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index a72c2d21898..2ff5686c78d 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -16,7 +16,7 @@ module QA end def sandbox_name - 'gitlab-qa-sandbox' + ENV['GITLAB_SANDBOX_NAME'] || 'gitlab-qa-sandbox' end end end -- cgit v1.2.1 From 5f62a935c3522517bffb6f4e0f48271dd81a9f39 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 9 Feb 2018 17:25:43 +0800 Subject: Move all ENV to Runtime::Env --- qa/qa/runtime/env.rb | 12 ++++++++++++ qa/qa/runtime/namespace.rb | 2 +- qa/qa/runtime/user.rb | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 56944e8b641..115d5ee58d1 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -16,6 +16,18 @@ module QA def personal_access_token ENV['PERSONAL_ACCESS_TOKEN'] end + + def user_username + ENV['GITLAB_USERNAME'] + end + + def user_password + ENV['GITLAB_PASSWORD'] + end + + def sandbox_name + ENV['GITLAB_SANDBOX_NAME'] + end end end end diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index 2ff5686c78d..8d05b387416 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -16,7 +16,7 @@ module QA end def sandbox_name - ENV['GITLAB_SANDBOX_NAME'] || 'gitlab-qa-sandbox' + Runtime::Env.sandbox_name || 'gitlab-qa-sandbox' end end end diff --git a/qa/qa/runtime/user.rb b/qa/qa/runtime/user.rb index 60027c89ab1..6b377f6b287 100644 --- a/qa/qa/runtime/user.rb +++ b/qa/qa/runtime/user.rb @@ -4,11 +4,11 @@ module QA extend self def name - ENV['GITLAB_USERNAME'] || 'root' + Runtime::Env.user_username || 'root' end def password - ENV['GITLAB_PASSWORD'] || '5iveL!fe' + Runtime::Env.user_password || '5iveL!fe' end end end -- cgit v1.2.1