From 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 20 Aug 2020 18:42:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-3-stable-ee --- .../atomic_processing_service_spec.rb | 10 +-- .../legacy_processing_service_spec.rb | 35 --------- .../shared_processing_service.rb | 3 +- .../shared_processing_service_tests_with_yaml.rb | 2 +- .../dag_build_allow_failure_test_on_failure.yml | 47 ------------- .../dag_build_fails_other_build_succeeds.yml | 62 ---------------- ...ld_fails_other_build_succeeds_deploy_always.yml | 63 ----------------- ...ld_succeeds_deploy_needs_one_build_and_test.yml | 62 ++++++++++++++++ ...deploy_needs_one_build_and_test_when_always.yml | 63 +++++++++++++++++ .../dag_build_fails_test_allow_failure.yml | 40 ----------- ...g_build_fails_test_fails_with_allow_failure.yml | 40 +++++++++++ ...ild_fails_test_on_failure_deploy_needs_test.yml | 66 +++++++++++++++++ ...ld_fails_with_allow_failure_test_on_failure.yml | 47 +++++++++++++ ...manual_allow_failure_true_deploy_needs_both.yml | 41 +++++++++++ ...manual_allow_failure_true_deploy_needs_test.yml | 41 +++++++++++ ..._succeeds_test_on_failure_deploy_needs_test.yml | 40 +++++++++++ .../dag_build_test_manual_review_deploy.yml | 82 ++++++++++++++++++++++ .../dag_builds_succeed_test_on_failure.yml | 63 ----------------- ...uilds_succeed_test_on_failure_deploy_always.yml | 64 ----------------- ..._on_failure_deploy_needs_one_build_and_test.yml | 63 +++++++++++++++++ ...deploy_needs_one_build_and_test_when_always.yml | 64 +++++++++++++++++ .../test_cases/dag_deploy_needs_empty.yml | 27 +++++++ .../test_cases/dag_test_allow_failure_true.yml | 43 ------------ .../dag_test_fails_with_allow_failure.yml | 43 ++++++++++++ ...st_manual_allow_failure_false_deploy_always.yml | 45 ++++++++++++ ...anual_allow_failure_false_deploy_on_failure.yml | 45 ++++++++++++ ...false_other_test_succeeds_deploy_needs_both.yml | 40 +++++++++++ ...nual_allow_failure_true_other_test_succeeds.yml | 42 ----------- ..._true_other_test_succeeds_deploy_needs_both.yml | 42 +++++++++++ .../dag_test_on_failure_with_failure.yml | 66 ----------------- .../dag_test_on_failure_with_success.yml | 40 ----------- .../stage_build_allow_failure_test_on_failure.yml | 53 -------------- .../stage_build_fails_test_allow_failure.yml | 39 ---------- .../stage_build_fails_test_on_failure.yml | 52 ++++++++++++++ ...ld_fails_with_allow_failure_test_on_failure.yml | 53 ++++++++++++++ ...ild_succeeds_test_manual_allow_failure_true.yml | 40 +++++++++++ .../stage_build_succeeds_test_on_failure.yml | 52 ++++++++++++++ .../stage_build_test_manual_review_deploy.yml | 79 +++++++++++++++++++++ ...est_manual_allow_failure_true_deploy_always.yml | 23 ++++++ .../stage_test_on_failure_with_failure.yml | 52 -------------- .../stage_test_on_failure_with_success.yml | 52 -------------- 41 files changed, 1153 insertions(+), 773 deletions(-) delete mode 100644 spec/services/ci/pipeline_processing/legacy_processing_service_spec.rb delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_allow_failure_test_on_failure.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_always.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test_when_always.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_allow_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_fails_with_allow_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure_deploy_needs_test.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_fails_with_allow_failure_test_on_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_both.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_test.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure_deploy_needs_test.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_build_test_manual_review_deploy.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_always.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test_when_always.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_deploy_needs_empty.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_fails_with_allow_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_always.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_on_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_other_test_succeeds_deploy_needs_both.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds_deploy_needs_both.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_failure.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_allow_failure_test_on_failure.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_on_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_fails_with_allow_failure_test_on_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_manual_allow_failure_true.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_on_failure.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_build_test_manual_review_deploy.yml create mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_always.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_failure.yml delete mode 100644 spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.yml (limited to 'spec/services/ci/pipeline_processing') diff --git a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb index a10a333b462..bc8b6b2d113 100644 --- a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb +++ b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb @@ -5,20 +5,12 @@ require_relative 'shared_processing_service.rb' require_relative 'shared_processing_service_tests_with_yaml.rb' RSpec.describe Ci::PipelineProcessing::AtomicProcessingService do - before do - stub_feature_flags(ci_atomic_processing: true) - - # This feature flag is implicit - # Atomic Processing does not process statuses differently - stub_feature_flags(ci_composite_status: true) - end - it_behaves_like 'Pipeline Processing Service' it_behaves_like 'Pipeline Processing Service Tests With Yaml' private - def process_pipeline(initial_process: false) + def process_pipeline described_class.new(pipeline).execute end end diff --git a/spec/services/ci/pipeline_processing/legacy_processing_service_spec.rb b/spec/services/ci/pipeline_processing/legacy_processing_service_spec.rb deleted file mode 100644 index 569a6d62dc1..00000000000 --- a/spec/services/ci/pipeline_processing/legacy_processing_service_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_relative 'shared_processing_service.rb' -require_relative 'shared_processing_service_tests_with_yaml.rb' - -RSpec.describe Ci::PipelineProcessing::LegacyProcessingService do - before do - stub_feature_flags(ci_atomic_processing: false) - end - - context 'when ci_composite_status is enabled' do - before do - stub_feature_flags(ci_composite_status: true) - end - - it_behaves_like 'Pipeline Processing Service' - it_behaves_like 'Pipeline Processing Service Tests With Yaml' - end - - context 'when ci_composite_status is disabled' do - before do - stub_feature_flags(ci_composite_status: false) - end - - it_behaves_like 'Pipeline Processing Service' - it_behaves_like 'Pipeline Processing Service Tests With Yaml' - end - - private - - def process_pipeline(initial_process: false) - described_class.new(pipeline).execute(initial_process: initial_process) - end -end diff --git a/spec/services/ci/pipeline_processing/shared_processing_service.rb b/spec/services/ci/pipeline_processing/shared_processing_service.rb index 224066885b6..7de22b6a4cc 100644 --- a/spec/services/ci/pipeline_processing/shared_processing_service.rb +++ b/spec/services/ci/pipeline_processing/shared_processing_service.rb @@ -788,8 +788,7 @@ RSpec.shared_examples 'Pipeline Processing Service' do let!(:deploy_pages) { create_build('deploy_pages', stage: 'deploy', stage_idx: 2, scheduling_type: :dag) } it 'runs deploy_pages without waiting prior stages' do - # Ci::PipelineProcessing::LegacyProcessingService requires :initial_process parameter - expect(process_pipeline(initial_process: true)).to be_truthy + expect(process_pipeline).to be_truthy expect(stages).to eq(%w(pending created pending)) expect(builds.pending).to contain_exactly(linux_build, mac_build, deploy_pages) diff --git a/spec/services/ci/pipeline_processing/shared_processing_service_tests_with_yaml.rb b/spec/services/ci/pipeline_processing/shared_processing_service_tests_with_yaml.rb index 17d254ba48e..77645298bc7 100644 --- a/spec/services/ci/pipeline_processing/shared_processing_service_tests_with_yaml.rb +++ b/spec/services/ci/pipeline_processing/shared_processing_service_tests_with_yaml.rb @@ -42,7 +42,7 @@ RSpec.shared_context 'Pipeline Processing Service Tests With Yaml' do { pipeline: pipeline.status, - stages: pipeline.ordered_stages.pluck(:name, :status).to_h, + stages: pipeline.stages.pluck(:name, :status).to_h, jobs: pipeline.statuses.latest.pluck(:name, :status).to_h } end diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_allow_failure_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_allow_failure_test_on_failure.yml deleted file mode 100644 index cfc456387ff..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_build_allow_failure_test_on_failure.yml +++ /dev/null @@ -1,47 +0,0 @@ -config: - build: - stage: build - allow_failure: true - script: exit 1 - - test: - stage: test - when: on_failure - script: exit 0 - needs: [build] - - deploy: - stage: deploy - script: exit 0 - needs: [test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: skipped - jobs: - build: failed - test: skipped - deploy: skipped - -# TODO: What is the real expected behavior here? -# Is `needs` keyword a requirement indicator or just a helper to build dependency tree? -# How should it behave `when: on_failure` with `needs`? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds.yml deleted file mode 100644 index a133023b12d..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds.yml +++ /dev/null @@ -1,62 +0,0 @@ -config: - build_1: - stage: build - script: exit 0 - - build_2: - stage: build - script: exit 1 - - test: - stage: test - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - needs: [build_1, test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build_1: pending - build_2: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build_1] - expect: - pipeline: running - stages: - build: running - test: created - deploy: created - jobs: - build_1: success - build_2: pending - test: created - deploy: created - - - event: drop - jobs: [build_2] - expect: - pipeline: running - stages: - build: failed - test: skipped - deploy: pending - jobs: - build_1: success - build_2: failed - test: skipped - deploy: pending - -# TODO: should we run deploy? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_always.yml deleted file mode 100644 index 4c676761e5c..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_always.yml +++ /dev/null @@ -1,63 +0,0 @@ -config: - build_1: - stage: build - script: exit 0 - - build_2: - stage: build - script: exit 1 - - test: - stage: test - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - when: always - needs: [build_1, test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build_1: pending - build_2: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build_1] - expect: - pipeline: running - stages: - build: running - test: created - deploy: created - jobs: - build_1: success - build_2: pending - test: created - deploy: created - - - event: drop - jobs: [build_2] - expect: - pipeline: running - stages: - build: failed - test: skipped - deploy: pending - jobs: - build_1: success - build_2: failed - test: skipped - deploy: pending - -# TODO: what's the actual expected behavior here? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test.yml new file mode 100644 index 00000000000..a133023b12d --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test.yml @@ -0,0 +1,62 @@ +config: + build_1: + stage: build + script: exit 0 + + build_2: + stage: build + script: exit 1 + + test: + stage: test + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + needs: [build_1, test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build_1: pending + build_2: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build_1] + expect: + pipeline: running + stages: + build: running + test: created + deploy: created + jobs: + build_1: success + build_2: pending + test: created + deploy: created + + - event: drop + jobs: [build_2] + expect: + pipeline: running + stages: + build: failed + test: skipped + deploy: pending + jobs: + build_1: success + build_2: failed + test: skipped + deploy: pending + +# TODO: should we run deploy? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test_when_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test_when_always.yml new file mode 100644 index 00000000000..4c676761e5c --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_needs_one_build_and_test_when_always.yml @@ -0,0 +1,63 @@ +config: + build_1: + stage: build + script: exit 0 + + build_2: + stage: build + script: exit 1 + + test: + stage: test + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + when: always + needs: [build_1, test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build_1: pending + build_2: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build_1] + expect: + pipeline: running + stages: + build: running + test: created + deploy: created + jobs: + build_1: success + build_2: pending + test: created + deploy: created + + - event: drop + jobs: [build_2] + expect: + pipeline: running + stages: + build: failed + test: skipped + deploy: pending + jobs: + build_1: success + build_2: failed + test: skipped + deploy: pending + +# TODO: what's the actual expected behavior here? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_allow_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_allow_failure.yml deleted file mode 100644 index ea7046262c3..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_allow_failure.yml +++ /dev/null @@ -1,40 +0,0 @@ -config: - build: - stage: build - script: exit 1 - - test: - stage: test - allow_failure: true - script: exit 1 - - deploy: - stage: deploy - script: exit 0 - needs: [test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: failed - stages: - build: failed - test: skipped - deploy: skipped - jobs: - build: failed - test: skipped - deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_fails_with_allow_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_fails_with_allow_failure.yml new file mode 100644 index 00000000000..ea7046262c3 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_fails_with_allow_failure.yml @@ -0,0 +1,40 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: failed + stages: + build: failed + test: skipped + deploy: skipped + jobs: + build: failed + test: skipped + deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure_deploy_needs_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure_deploy_needs_test.yml new file mode 100644 index 00000000000..5ace621e89c --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure_deploy_needs_test.yml @@ -0,0 +1,66 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + when: on_failure + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: running + stages: + build: failed + test: pending + deploy: created + jobs: + build: failed + test: pending + deploy: created + + - event: success + jobs: [test] + expect: + pipeline: running + stages: + build: failed + test: success + deploy: pending + jobs: + build: failed + test: success + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: failed + stages: + build: failed + test: success + deploy: success + jobs: + build: failed + test: success + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_with_allow_failure_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_with_allow_failure_test_on_failure.yml new file mode 100644 index 00000000000..cfc456387ff --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_with_allow_failure_test_on_failure.yml @@ -0,0 +1,47 @@ +config: + build: + stage: build + allow_failure: true + script: exit 1 + + test: + stage: test + when: on_failure + script: exit 0 + needs: [build] + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: skipped + jobs: + build: failed + test: skipped + deploy: skipped + +# TODO: What is the real expected behavior here? +# Is `needs` keyword a requirement indicator or just a helper to build dependency tree? +# How should it behave `when: on_failure` with `needs`? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_both.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_both.yml new file mode 100644 index 00000000000..60f803bc3d0 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_both.yml @@ -0,0 +1,41 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [build, test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: created + jobs: + build: success + test: manual + deploy: created diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_test.yml new file mode 100644 index 00000000000..4e4b2f22224 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeds_test_manual_allow_failure_true_deploy_needs_test.yml @@ -0,0 +1,41 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: manual + allow_failure: true + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: created + jobs: + build: success + test: manual + deploy: created diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure_deploy_needs_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure_deploy_needs_test.yml new file mode 100644 index 00000000000..19524cfd3e4 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure_deploy_needs_test.yml @@ -0,0 +1,40 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: on_failure + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: skipped + jobs: + build: success + test: skipped + deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_test_manual_review_deploy.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_test_manual_review_deploy.yml new file mode 100644 index 00000000000..fef28dcfbbe --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_test_manual_review_deploy.yml @@ -0,0 +1,82 @@ +config: + stages: [build, test, review, deploy] + + build: + stage: build + script: exit 0 + + test: + stage: test + script: exit 0 + + release_test: + stage: test + when: manual + allow_failure: true + script: exit 0 + + review: + stage: review + script: exit 0 + needs: [test, release_test] + + staging: + stage: deploy + script: exit 0 + needs: [test, release_test] + + production: + stage: deploy + script: exit 0 + needs: [review] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + review: created + deploy: created + jobs: + build: pending + test: created + release_test: created + review: created + staging: created + production: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: pending + review: created + deploy: created + jobs: + build: success + test: pending + release_test: manual + review: created + staging: created + production: created + + - event: success + jobs: [test] + expect: + pipeline: running + stages: + build: success + test: success + review: created + deploy: created + jobs: + build: success + test: success + release_test: manual + review: created + staging: created + production: created diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.yml deleted file mode 100644 index f324525bd56..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.yml +++ /dev/null @@ -1,63 +0,0 @@ -config: - build_1: - stage: build - script: exit 0 - - build_2: - stage: build - script: exit 0 - - test: - stage: test - script: exit 0 - when: on_failure - - deploy: - stage: deploy - script: exit 0 - needs: [build_1, test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build_1: pending - build_2: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build_1, build_2] - expect: - pipeline: running - stages: - build: success - test: skipped - deploy: pending - jobs: - build_1: success - build_2: success - test: skipped - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: success - jobs: - build_1: success - build_2: success - test: skipped - deploy: success - -# TODO: should we run deploy? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_always.yml deleted file mode 100644 index 9986dbaa215..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_always.yml +++ /dev/null @@ -1,64 +0,0 @@ -config: - build_1: - stage: build - script: exit 0 - - build_2: - stage: build - script: exit 0 - - test: - stage: test - script: exit 0 - when: on_failure - - deploy: - stage: deploy - script: exit 0 - when: always - needs: [build_1, test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build_1: pending - build_2: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build_1, build_2] - expect: - pipeline: running - stages: - build: success - test: skipped - deploy: pending - jobs: - build_1: success - build_2: success - test: skipped - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: success - jobs: - build_1: success - build_2: success - test: skipped - deploy: success - -# TODO: should we run deploy? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test.yml new file mode 100644 index 00000000000..f324525bd56 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test.yml @@ -0,0 +1,63 @@ +config: + build_1: + stage: build + script: exit 0 + + build_2: + stage: build + script: exit 0 + + test: + stage: test + script: exit 0 + when: on_failure + + deploy: + stage: deploy + script: exit 0 + needs: [build_1, test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build_1: pending + build_2: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build_1, build_2] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: pending + jobs: + build_1: success + build_2: success + test: skipped + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: success + jobs: + build_1: success + build_2: success + test: skipped + deploy: success + +# TODO: should we run deploy? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test_when_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test_when_always.yml new file mode 100644 index 00000000000..9986dbaa215 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_needs_one_build_and_test_when_always.yml @@ -0,0 +1,64 @@ +config: + build_1: + stage: build + script: exit 0 + + build_2: + stage: build + script: exit 0 + + test: + stage: test + script: exit 0 + when: on_failure + + deploy: + stage: deploy + script: exit 0 + when: always + needs: [build_1, test] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build_1: pending + build_2: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build_1, build_2] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: pending + jobs: + build_1: success + build_2: success + test: skipped + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: success + jobs: + build_1: success + build_2: success + test: skipped + deploy: success + +# TODO: should we run deploy? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_deploy_needs_empty.yml b/spec/services/ci/pipeline_processing/test_cases/dag_deploy_needs_empty.yml new file mode 100644 index 00000000000..1783c0acb11 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_deploy_needs_empty.yml @@ -0,0 +1,27 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + needs: [] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: pending + jobs: + build: pending + test: created + deploy: pending + +transitions: [] diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.yml deleted file mode 100644 index 8d4d9d403f1..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.yml +++ /dev/null @@ -1,43 +0,0 @@ -config: - test: - stage: test - allow_failure: true - script: exit 1 - - deploy: - stage: deploy - script: exit 0 - needs: [test] - -init: - expect: - pipeline: pending - stages: - test: pending - deploy: created - jobs: - test: pending - deploy: created - -transitions: - - event: drop - jobs: [test] - expect: - pipeline: pending - stages: - test: success - deploy: pending - jobs: - test: failed - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: success - stages: - test: success - deploy: success - jobs: - test: failed - deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_fails_with_allow_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_fails_with_allow_failure.yml new file mode 100644 index 00000000000..8d4d9d403f1 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_fails_with_allow_failure.yml @@ -0,0 +1,43 @@ +config: + test: + stage: test + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: pending + stages: + test: pending + deploy: created + jobs: + test: pending + deploy: created + +transitions: + - event: drop + jobs: [test] + expect: + pipeline: pending + stages: + test: success + deploy: pending + jobs: + test: failed + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + test: success + deploy: success + jobs: + test: failed + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_always.yml new file mode 100644 index 00000000000..bb8723aa303 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_always.yml @@ -0,0 +1,45 @@ +config: + test: + stage: test + when: manual + allow_failure: false + script: exit 1 + + deploy: + stage: deploy + when: always + script: exit 0 + needs: [test] + +init: + expect: + pipeline: manual + stages: + test: manual + deploy: created + jobs: + test: manual + deploy: created + +transitions: + - event: enqueue + jobs: [test] + expect: + pipeline: pending + stages: + test: pending + deploy: created + jobs: + test: pending + deploy: created + + - event: drop + jobs: [test] + expect: + pipeline: running + stages: + test: failed + deploy: pending + jobs: + test: failed + deploy: pending diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_on_failure.yml new file mode 100644 index 00000000000..3099a94befb --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_deploy_on_failure.yml @@ -0,0 +1,45 @@ +config: + test: + stage: test + when: manual + allow_failure: false + script: exit 1 + + deploy: + stage: deploy + when: on_failure + script: exit 0 + needs: [test] + +init: + expect: + pipeline: manual + stages: + test: manual + deploy: created + jobs: + test: manual + deploy: created + +transitions: + - event: enqueue + jobs: [test] + expect: + pipeline: pending + stages: + test: pending + deploy: created + jobs: + test: pending + deploy: created + + - event: drop + jobs: [test] + expect: + pipeline: running + stages: + test: failed + deploy: pending + jobs: + test: failed + deploy: pending diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_other_test_succeeds_deploy_needs_both.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_other_test_succeeds_deploy_needs_both.yml new file mode 100644 index 00000000000..7330a73b5a3 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false_other_test_succeeds_deploy_needs_both.yml @@ -0,0 +1,40 @@ +config: + test1: + stage: test + script: exit 0 + + test2: + stage: test + when: manual + allow_failure: false + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [test1, test2] + +init: + expect: + pipeline: running + stages: + test: running + deploy: created + jobs: + test1: pending + test2: manual + deploy: created + +transitions: + - event: success + jobs: [test1] + expect: + pipeline: manual + stages: + test: manual + deploy: created + jobs: + test1: success + test2: manual + deploy: created + diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds.yml deleted file mode 100644 index 34073b92ccc..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds.yml +++ /dev/null @@ -1,42 +0,0 @@ -config: - test1: - stage: test - script: exit 0 - - test2: - stage: test - when: manual - allow_failure: true - script: exit 1 - - deploy: - stage: deploy - script: exit 0 - needs: [test1, test2] - -init: - expect: - pipeline: pending - stages: - test: pending - deploy: created - jobs: - test1: pending - test2: manual - deploy: created - -transitions: - - event: success - jobs: [test1] - expect: - pipeline: running - stages: - test: success - deploy: created - jobs: - test1: success - test2: manual - deploy: created - -# TODO: should deploy run? -# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds_deploy_needs_both.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds_deploy_needs_both.yml new file mode 100644 index 00000000000..34073b92ccc --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_other_test_succeeds_deploy_needs_both.yml @@ -0,0 +1,42 @@ +config: + test1: + stage: test + script: exit 0 + + test2: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [test1, test2] + +init: + expect: + pipeline: pending + stages: + test: pending + deploy: created + jobs: + test1: pending + test2: manual + deploy: created + +transitions: + - event: success + jobs: [test1] + expect: + pipeline: running + stages: + test: success + deploy: created + jobs: + test1: success + test2: manual + deploy: created + +# TODO: should deploy run? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_failure.yml deleted file mode 100644 index 5ace621e89c..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_failure.yml +++ /dev/null @@ -1,66 +0,0 @@ -config: - build: - stage: build - script: exit 1 - - test: - stage: test - when: on_failure - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - needs: [test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: running - stages: - build: failed - test: pending - deploy: created - jobs: - build: failed - test: pending - deploy: created - - - event: success - jobs: [test] - expect: - pipeline: running - stages: - build: failed - test: success - deploy: pending - jobs: - build: failed - test: success - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: failed - stages: - build: failed - test: success - deploy: success - jobs: - build: failed - test: success - deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.yml deleted file mode 100644 index 19524cfd3e4..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.yml +++ /dev/null @@ -1,40 +0,0 @@ -config: - build: - stage: build - script: exit 0 - - test: - stage: test - when: on_failure - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - needs: [test] - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: skipped - jobs: - build: success - test: skipped - deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_allow_failure_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_allow_failure_test_on_failure.yml deleted file mode 100644 index 3e081d4411b..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/stage_build_allow_failure_test_on_failure.yml +++ /dev/null @@ -1,53 +0,0 @@ -config: - build: - stage: build - allow_failure: true - script: exit 1 - - test: - stage: test - when: on_failure - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: pending - stages: - build: success - test: skipped - deploy: pending - jobs: - build: failed - test: skipped - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: success - jobs: - build: failed - test: skipped - deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml deleted file mode 100644 index 362ac6e4239..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml +++ /dev/null @@ -1,39 +0,0 @@ -config: - build: - stage: build - script: exit 1 - - test: - stage: test - allow_failure: true - script: exit 1 - - deploy: - stage: deploy - script: exit 0 - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: failed - stages: - build: failed - test: skipped - deploy: skipped - jobs: - build: failed - test: skipped - deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_on_failure.yml new file mode 100644 index 00000000000..1751cbb2023 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_on_failure.yml @@ -0,0 +1,52 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + when: on_failure + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: running + stages: + build: failed + test: pending + deploy: created + jobs: + build: failed + test: pending + deploy: created + + - event: success + jobs: [test] + expect: + pipeline: failed + stages: + build: failed + test: success + deploy: skipped + jobs: + build: failed + test: success + deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_with_allow_failure_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_with_allow_failure_test_on_failure.yml new file mode 100644 index 00000000000..3e081d4411b --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_with_allow_failure_test_on_failure.yml @@ -0,0 +1,53 @@ +config: + build: + stage: build + allow_failure: true + script: exit 1 + + test: + stage: test + when: on_failure + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: pending + stages: + build: success + test: skipped + deploy: pending + jobs: + build: failed + test: skipped + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: success + jobs: + build: failed + test: skipped + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_manual_allow_failure_true.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_manual_allow_failure_true.yml new file mode 100644 index 00000000000..2fd85b74d4d --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_manual_allow_failure_true.yml @@ -0,0 +1,40 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: pending + jobs: + build: success + test: manual + deploy: pending diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_on_failure.yml new file mode 100644 index 00000000000..15afe1ce8e1 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_succeeds_test_on_failure.yml @@ -0,0 +1,52 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: on_failure + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + deploy: created + jobs: + build: pending + test: created + deploy: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: skipped + deploy: pending + jobs: + build: success + test: skipped + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + build: success + test: skipped + deploy: success + jobs: + build: success + test: skipped + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_build_test_manual_review_deploy.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_test_manual_review_deploy.yml new file mode 100644 index 00000000000..2829765fd95 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_test_manual_review_deploy.yml @@ -0,0 +1,79 @@ +config: + stages: [build, test, review, deploy] + + build: + stage: build + script: exit 0 + + test: + stage: test + script: exit 0 + + release_test: + stage: test + when: manual + allow_failure: true + script: exit 0 + + review: + stage: review + script: exit 0 + + staging: + stage: deploy + script: exit 0 + + production: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + review: created + deploy: created + jobs: + build: pending + test: created + release_test: created + review: created + staging: created + production: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: running + stages: + build: success + test: pending + review: created + deploy: created + jobs: + build: success + test: pending + release_test: manual + review: created + staging: created + production: created + + - event: success + jobs: [test] + expect: + pipeline: running + stages: + build: success + test: success + review: pending + deploy: created + jobs: + build: success + test: success + release_test: manual + review: pending + staging: created + production: created diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_always.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_always.yml new file mode 100644 index 00000000000..9181c8adf50 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_always.yml @@ -0,0 +1,23 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + when: always + script: exit 0 + +init: + expect: + pipeline: pending + stages: + test: skipped + deploy: pending + jobs: + test: manual + deploy: pending + +transitions: [] diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_failure.yml deleted file mode 100644 index 1751cbb2023..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_failure.yml +++ /dev/null @@ -1,52 +0,0 @@ -config: - build: - stage: build - script: exit 1 - - test: - stage: test - when: on_failure - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: drop - jobs: [build] - expect: - pipeline: running - stages: - build: failed - test: pending - deploy: created - jobs: - build: failed - test: pending - deploy: created - - - event: success - jobs: [test] - expect: - pipeline: failed - stages: - build: failed - test: success - deploy: skipped - jobs: - build: failed - test: success - deploy: skipped diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.yml deleted file mode 100644 index 15afe1ce8e1..00000000000 --- a/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.yml +++ /dev/null @@ -1,52 +0,0 @@ -config: - build: - stage: build - script: exit 0 - - test: - stage: test - when: on_failure - script: exit 0 - - deploy: - stage: deploy - script: exit 0 - -init: - expect: - pipeline: pending - stages: - build: pending - test: created - deploy: created - jobs: - build: pending - test: created - deploy: created - -transitions: - - event: success - jobs: [build] - expect: - pipeline: running - stages: - build: success - test: skipped - deploy: pending - jobs: - build: success - test: skipped - deploy: pending - - - event: success - jobs: [deploy] - expect: - pipeline: success - stages: - build: success - test: skipped - deploy: success - jobs: - build: success - test: skipped - deploy: success -- cgit v1.2.3