summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb')
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb77
1 files changed, 18 insertions, 59 deletions
diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
index a4849d47183..81ccd36c514 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
@@ -2,10 +2,7 @@
module QA
RSpec.describe 'Verify', :runner do
- describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring, feature_flag: {
- name: 'ci_raw_variables_in_yaml_config',
- scope: :project
- } do
+ describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
let(:pipeline_job_name) { 'rspec' }
@@ -16,14 +13,14 @@ module QA
end
let!(:runner) do
- Resource::Runner.fabricate! do |runner|
+ Resource::ProjectRunner.fabricate! do |runner|
runner.project = project
runner.name = executor
runner.tags = [executor]
end
end
- let(:commit_ci_file) do
+ let!(:commit_ci_file) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
@@ -76,10 +73,7 @@ module QA
let(:pipeline_id) { project.pipelines.first[:id] }
let(:job_id) { project.job_by_name(pipeline_job_name)[:id] }
- def before_do
- # TODO: Switch to use `let!` and remove this line when removing FF
- commit_ci_file
-
+ before do
Flow::Login.sign_in
project.visit!
Flow::Pipeline.visit_latest_pipeline(status: 'passed')
@@ -92,55 +86,20 @@ module QA
runner&.remove_via_api!
end
- context 'when FF is on', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487' do
- before do
- Runtime::Feature.enable(:ci_raw_variables_in_yaml_config, project: project)
- sleep 60
-
- before_do
- end
-
- it 'expands variables according to expand: true/false', :aggregate_failures do
- Page::Project::Job::Show.perform do |show|
- expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1")
- expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID")
- expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID")
- expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4")
- expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
- expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID")
- end
- end
- end
-
- # TODO: Remove this context when FF :ci_raw_variables_in_yaml_config is removed
- # Also archive testcase and close related issue
- context 'when FF is off',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381486',
- quarantine: {
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/381806',
- only: { pipeline: %w[staging staging-canary staging-ref] },
- type: :waiting_on
- } do
- before do
- Runtime::Feature.disable(:ci_raw_variables_in_yaml_config, project: project)
- sleep 60
-
- before_do
- end
-
- it 'expands all variables', :aggregate_failures do
- Page::Project::Job::Show.perform do |show|
- expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR3 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR4 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR6 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
- expect(show.output).to have_content("VAR8 is value 8 #{pipeline_id}")
- end
+ it(
+ 'expands variables according to expand: true/false',
+ :aggregate_failures,
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487'
+ ) do
+ Page::Project::Job::Show.perform do |show|
+ expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
+ expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
+ expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1")
+ expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID")
+ expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID")
+ expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4")
+ expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
+ expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID")
end
end
end