summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-27 21:09:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-27 21:09:58 +0000
commit1f992463a93d2db88a661dd2a60a1f0a81375f44 (patch)
tree396a12aa7f82d2c7e2ebf672fda9993796eae5cf /qa
parentbd746eebdc82ea3731b38cd903a999569ff3b8be (diff)
downloadgitlab-ce-1f992463a93d2db88a661dd2a60a1f0a81375f44.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/runtime/allure_report.rb9
-rw-r--r--qa/qa/specs/features/api/4_verify/file_variable_spec.rb70
2 files changed, 26 insertions, 53 deletions
diff --git a/qa/qa/runtime/allure_report.rb b/qa/qa/runtime/allure_report.rb
index 10f47ca56ba..a9152a5555c 100644
--- a/qa/qa/runtime/allure_report.rb
+++ b/qa/qa/runtime/allure_report.rb
@@ -96,9 +96,14 @@ module QA
return {} unless Env.admin_personal_access_token || Env.personal_access_token
client = Env.admin_personal_access_token ? API::Client.as_admin : API::Client.new
- response = get(API::Request.new(client, '/version').url)
+ response = get(API::Request.new(client, '/metadata').url)
- JSON.parse(response.body, symbolize_names: true)
+ JSON.parse(response.body, symbolize_names: true).then do |metadata|
+ {
+ **metadata.slice(:version, :revision),
+ kas_version: metadata.dig(:kas, :version)
+ }.compact
+ end
rescue StandardError, ArgumentError => e
Logger.error("Failed to attach version info to allure report: #{e}")
{}
diff --git a/qa/qa/specs/features/api/4_verify/file_variable_spec.rb b/qa/qa/specs/features/api/4_verify/file_variable_spec.rb
index 5d6bc5a44f7..4ae97f589cf 100644
--- a/qa/qa/specs/features/api/4_verify/file_variable_spec.rb
+++ b/qa/qa/specs/features/api/4_verify/file_variable_spec.rb
@@ -1,10 +1,7 @@
# frozen_string_literal: true
module QA
- RSpec.describe 'Verify', :runner, product_group: :pipeline_authoring, feature_flag: {
- name: 'ci_stop_expanding_file_vars_for_runners',
- scope: :project
- } do
+ RSpec.describe 'Verify', :runner, product_group: :pipeline_authoring do
describe 'Pipeline with project file variables' do
let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(number: 8)}" }
@@ -14,7 +11,7 @@ module QA
end
end
- let(:runner) do
+ let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.project = project
runner.name = executor
@@ -60,59 +57,30 @@ module QA
end
end
- after do
- runner.remove_via_api!
+ before do
+ add_file_variables
+ add_ci_file
+ trigger_pipeline
+ wait_for_pipeline
end
- shared_examples 'variables are read correctly' do
- it 'shows in job log accordingly' do
- job = Resource::Job.fabricate_via_api! do |job|
- job.project = project
- job.id = project.job_by_name('test')[:id]
- end
-
- aggregate_failures do
- trace = job.trace
- expect(trace).to have_content('run something -f hello, this is test')
- expect(trace).to have_content('docker run --tlscacert="This is secret"')
- expect(trace).to have_content('run --output=This is secret.crt')
- expect(trace).to have_content('Will read private key from hello, this is test')
- end
- end
+ after do
+ runner.remove_via_api!
end
- # FF does not change current behavior
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94198#note_1057609893
- #
- # TODO: Remove when FF is removed
- # TODO: Archive testcase issue when FF is removed
- # Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/issues/369907
- context 'when FF is on', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/370787' do
- before do
- Runtime::Feature.enable(:ci_stop_expanding_file_vars_for_runners, project: project)
-
- runner
- add_file_variables
- add_ci_file
- trigger_pipeline
- wait_for_pipeline
+ it 'shows in job log accordingly', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/370791' do
+ job = Resource::Job.fabricate_via_api! do |job|
+ job.project = project
+ job.id = project.job_by_name('test')[:id]
end
- it_behaves_like 'variables are read correctly'
- end
-
- # TODO: Refactor when FF is removed
- # TODO: Update testcase issue title and description to not refer to FF status
- context 'when FF is off', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/370791' do
- before do
- runner
- add_file_variables
- add_ci_file
- trigger_pipeline
- wait_for_pipeline
+ aggregate_failures do
+ trace = job.trace
+ expect(trace).to have_content('run something -f hello, this is test')
+ expect(trace).to have_content('docker run --tlscacert="This is secret"')
+ expect(trace).to have_content('run --output=This is secret.crt')
+ expect(trace).to have_content('Will read private key from hello, this is test')
end
-
- it_behaves_like 'variables are read correctly'
end
private