diff --git a/qa/qa/runtime/api/client.rb b/qa/qa/runtime/api/client.rb index aff84c89f0e70ac336ee465ac9d9af6b3477ead8..d3327b493393f6563370c9f704e989e6458f8221 100644 --- a/qa/qa/runtime/api/client.rb +++ b/qa/qa/runtime/api/client.rb @@ -14,7 +14,7 @@ def initialize(address = :gitlab, personal_access_token: nil, is_new_session: tr def personal_access_token @personal_access_token ||= begin - # you can set the environment variable PERSONAL_ACCESS_TOKEN + # you can set the environment variable GITLAB_QA_ACCESS_TOKEN # to use a specific access token rather than create one from the UI Runtime::Env.personal_access_token ||= create_personal_access_token end diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index dd0ddbdbd6b83fe7565e271020d1f48bd6bec8c9..03cae3c1fe625065f111d998fcf108dee517adb1 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -53,7 +53,7 @@ def signup_disabled? # specifies token that can be used for the api def personal_access_token - @personal_access_token ||= ENV['PERSONAL_ACCESS_TOKEN'] + @personal_access_token ||= ENV['GITLAB_QA_ACCESS_TOKEN'] end def remote_grid diff --git a/qa/qa/tools/delete_subgroups.rb b/qa/qa/tools/delete_subgroups.rb index c5c48e77ade1fbc4fe8ff0d7b117fe48e3930995..3f752adbe6fbad00006241dbdbae2c7d89821123 100644 --- a/qa/qa/tools/delete_subgroups.rb +++ b/qa/qa/tools/delete_subgroups.rb @@ -3,7 +3,7 @@ require_relative '../../qa' # This script deletes all subgroups of a group specified by ENV['GROUP_NAME_OR_PATH'] -# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS +# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS # Optional environment variable: GROUP_NAME_OR_PATH (defaults to 'gitlab-qa-sandbox-group') # Run `rake delete_subgroups` @@ -14,9 +14,9 @@ class DeleteSubgroups def initialize raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS'] - raise ArgumentError, "Please provide PERSONAL_ACCESS_TOKEN" unless ENV['PERSONAL_ACCESS_TOKEN'] + raise ArgumentError, "Please provide GITLAB_QA_ACCESS_TOKEN" unless ENV['GITLAB_QA_ACCESS_TOKEN'] - @api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['PERSONAL_ACCESS_TOKEN']) + @api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['GITLAB_QA_ACCESS_TOKEN']) end def run diff --git a/qa/qa/tools/generate_perf_testdata.rb b/qa/qa/tools/generate_perf_testdata.rb index 4fda49c8e488c44ebf6ebb4d6afb065c5d90a684..49a1af8e9f01c488fbf501d7766e80ebc43dc017 100644 --- a/qa/qa/tools/generate_perf_testdata.rb +++ b/qa/qa/tools/generate_perf_testdata.rb @@ -5,7 +5,7 @@ require 'yaml' require_relative '../../qa' # This script generates testdata for Performance Testing. -# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS +# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS # This job creates a urls.txt which contains a hash of all the URLs needed for Performance Testing # Run `rake generate_perf_testdata` @@ -16,9 +16,9 @@ class GeneratePerfTestdata def initialize raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS'] - raise ArgumentError, "Please provide PERSONAL_ACCESS_TOKEN" unless ENV['PERSONAL_ACCESS_TOKEN'] + raise ArgumentError, "Please provide GITLAB_QA_ACCESS_TOKEN" unless ENV['GITLAB_QA_ACCESS_TOKEN'] - @api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['PERSONAL_ACCESS_TOKEN']) + @api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['GITLAB_QA_ACCESS_TOKEN']) @group_name = "gitlab-qa-perf-sandbox-#{SecureRandom.hex(8)}" @project_name = "my-test-project-#{SecureRandom.hex(8)}" @visibility = "public" diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index fc51f45c3a14796770ee6bf1ef482aed43a1cf8d..04085efe2cea9a7e01d41ba5588260d0d04d34ad 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -90,13 +90,13 @@ described_class.instance_variable_set(:@personal_access_token, nil) end - context 'when PERSONAL_ACCESS_TOKEN is set' do + context 'when GITLAB_QA_ACCESS_TOKEN is set' do before do - stub_env('PERSONAL_ACCESS_TOKEN', 'a_token') + stub_env('GITLAB_QA_ACCESS_TOKEN', 'a_token_too') end it 'returns specified token from env' do - expect(described_class.personal_access_token).to eq 'a_token' + expect(described_class.personal_access_token).to eq 'a_token_too' end end