diff options
Diffstat (limited to 'qa/qa/specs/features/browser_ui/4_verify/ci_variable')
3 files changed, 94 insertions, 3 deletions
diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb new file mode 100644 index 00000000000..63801536c34 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Verify', :runner do + describe 'Pipeline with customizable variable' do + let(:executor) { "qa-runner-#{Time.now.to_i}" } + let(:pipeline_job_name) { 'customizable-variable' } + let(:variable_custom_value) { 'Custom Foo' } + + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'project-with-customizable-variable-pipeline' + end + end + + let!(:runner) do + Resource::Runner.fabricate! do |runner| + runner.project = project + runner.name = executor + runner.tags = [executor] + end + end + + let!(:commit) do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files( + [ + { + file_path: '.gitlab-ci.yml', + content: <<~YAML + variables: + FOO: + value: "Default Foo" + description: "This is a description for the foo variable" + #{pipeline_job_name}: + tags: + - #{executor} + script: echo "$FOO" + YAML + } + ] + ) + end + end + + before do + Flow::Login.sign_in + project.visit! + Page::Project::Menu.perform(&:click_ci_cd_pipelines) + Page::Project::Pipeline::Index.perform do |index| + index.click_run_pipeline_button + end + end + + after do + [runner, project].each(&:remove_via_api!) + end + + it( + 'manually creates a pipeline and uses the defined custom variable value', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/361814' + ) do + Page::Project::Pipeline::New.perform do |new| + new.configure_variable(value: variable_custom_value) + new.click_run_pipeline_button + end + + Page::Project::Pipeline::Show.perform do |show| + Support::Waiter.wait_until { show.passed? } + end + + job = Resource::Job.fabricate_via_api! do |job| + job.id = project.job_by_name(pipeline_job_name)[:id] + job.name = pipeline_job_name + job.project = project + end + + job.visit! + + Page::Project::Job::Show.perform do |show| + expect(show.output).to have_content(variable_custom_value) + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb index 496cc5f8a60..bd200e57ff9 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb @@ -24,7 +24,8 @@ module QA it( 'is inheritable when forward:pipeline_variables is true', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358197' + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358197', + quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361338', type: :investigating } ) do visit_job_page('child1', 'child1_job') verify_job_log_shows_variable_value diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb index 2a0aaf6d7a3..2bd0be542fe 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb @@ -25,7 +25,8 @@ module QA it( 'is not inheritable when forward:pipeline_variables is false', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358199' + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358199', + quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361339', type: :investigating } ) do visit_job_page('child1', 'child1_job') verify_job_log_does_not_show_variable_value @@ -39,7 +40,8 @@ module QA it( 'is not inheritable by default', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358200' + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358200', + quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361339', type: :investigating } ) do visit_job_page('child2', 'child2_job') verify_job_log_does_not_show_variable_value |