diff options
Diffstat (limited to 'qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb')
-rw-r--r-- | qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb new file mode 100644 index 00000000000..7a2c2b4ae90 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Verify', :runner, quarantine: { + type: :flaky, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/351994' + } do + describe 'Run pipeline with manual jobs' do + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'pipeline-with-manual-job' + project.description = 'Project for pipeline with manual job' + end + end + + let!(:runner) do + Resource::Runner.fabricate! do |runner| + runner.project = project + runner.name = "qa-runner-#{SecureRandom.hex(3)}" + end + end + + let!(:ci_file) 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 + stages: + - Stage1 + - Stage2 + - Stage3 + + Prep: + stage: Stage1 + script: exit 0 + when: manual + + Build: + stage: Stage2 + needs: ['Prep'] + script: exit 0 + parallel: 6 + + Test: + stage: Stage3 + needs: ['Build'] + script: exit 0 + + Deploy: + stage: Stage3 + needs: ['Test'] + script: exit 0 + parallel: 6 + YAML + } + ] + ) + end + end + + before do + Flow::Login.sign_in + project.visit! + Flow::Pipeline.visit_latest_pipeline(pipeline_condition: 'skipped') + end + + after do + runner&.remove_via_api! + project&.remove_via_api! + end + + it 'does not leave any job in skipped state', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349158' do + Page::Project::Pipeline::Show.perform do |show| + show.click_job_action('Prep') # Trigger pipeline manually + + show.wait_until(max_duration: 300, sleep_interval: 2, reload: false) do + project.pipelines.last[:status] == 'success' + end + + aggregate_failures do + expect(show).to have_build('Test', status: :success) + + show.click_job_dropdown('Build') + expect(show).not_to have_skipped_job_in_group + + show.click_job_dropdown('Build') # Close Build dropdown + show.click_job_dropdown('Deploy') + expect(show).not_to have_skipped_job_in_group + end + end + end + end + end +end |