diff options
Diffstat (limited to 'spec/services/ci/pipeline_processing/test_cases')
28 files changed, 1352 insertions, 0 deletions
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 new file mode 100644 index 00000000000..cfc456387ff --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_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_fails.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails.yml new file mode 100644 index 00000000000..e71ef194c5f --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails.yml @@ -0,0 +1,39 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + script: exit 0 + needs: [build] + + 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/dag_build_fails_deploy_needs_test.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_deploy_needs_test.yml new file mode 100644 index 00000000000..40a80f6f53b --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_deploy_needs_test.yml @@ -0,0 +1,39 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + 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: 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_deploy_needs_test_when_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_deploy_needs_test_when_always.yml new file mode 100644 index 00000000000..b0904a027f8 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_deploy_needs_test_when_always.yml @@ -0,0 +1,43 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + when: always + 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: skipped + deploy: pending + jobs: + build: failed + test: skipped + deploy: pending + +# TODO: `test` is actually skipped, but we run `deploy`. Should we? +# 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 new file mode 100644 index 00000000000..a133023b12d --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds.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_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_other_build_succeeds_deploy_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_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 new file mode 100644 index 00000000000..ea7046262c3 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_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_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_always.yml new file mode 100644 index 00000000000..8860f565cc7 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_always.yml @@ -0,0 +1,35 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + when: always + script: exit 0 + needs: [build] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + jobs: + build: pending + test: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: running + stages: + build: failed + test: pending + jobs: + build: failed + test: pending + +# TODO: Should we run `test`? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure.yml new file mode 100644 index 00000000000..3fa5a8034a2 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_fails_test_on_failure.yml @@ -0,0 +1,35 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + when: on_failure + script: exit 0 + needs: [build] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + jobs: + build: pending + test: created + +transitions: + - event: drop + jobs: [build] + expect: + pipeline: running + stages: + build: failed + test: pending + jobs: + build: failed + test: pending + +# TODO: Should we run `test`? +# Further discussions: https://gitlab.com/gitlab-org/gitlab/-/issues/213080 diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure.yml new file mode 100644 index 00000000000..700d4440802 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_build_succeeds_test_on_failure.yml @@ -0,0 +1,35 @@ +config: + build: + stage: build + script: exit 0 + + test: + stage: test + when: on_failure + script: exit 0 + needs: [build] + +init: + expect: + pipeline: pending + stages: + build: pending + test: created + jobs: + build: pending + test: created + +transitions: + - event: success + jobs: [build] + expect: + pipeline: success + stages: + build: success + test: skipped + jobs: + build: success + test: skipped + +# TODO: Should we run `test`? +# 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.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.yml new file mode 100644 index 00000000000..f324525bd56 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure.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_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_builds_succeed_test_on_failure_deploy_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_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_test_allow_failure_true.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.yml new file mode 100644 index 00000000000..8d4d9d403f1 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_allow_failure_true.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.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false.yml new file mode 100644 index 00000000000..1d61cd24f8c --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_false.yml @@ -0,0 +1,66 @@ +config: + test: + stage: test + when: manual + allow_failure: false + script: exit 0 + + deploy: + stage: deploy + 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: run + jobs: [test] + expect: + pipeline: running + stages: + test: running + deploy: created + jobs: + test: running + deploy: created + + - event: success + jobs: [test] + expect: + pipeline: running + stages: + test: success + deploy: pending + jobs: + test: success + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + test: success + deploy: success + jobs: + test: success + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true.yml new file mode 100644 index 00000000000..d8ca563b141 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true.yml @@ -0,0 +1,58 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + needs: [test] + +init: + expect: + pipeline: created + stages: + test: skipped + 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: run + jobs: [test] + expect: + pipeline: running + stages: + test: running + deploy: created + jobs: + test: running + deploy: created + + - event: drop + jobs: [test] + expect: + pipeline: running + stages: + test: success + deploy: pending + jobs: + test: failed + deploy: pending + +# TOOD: 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_test_manual_allow_failure_true_deploy_always.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_deploy_always.yml new file mode 100644 index 00000000000..ba0a20f49a7 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_deploy_always.yml @@ -0,0 +1,27 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + when: always + script: exit 0 + needs: [test] + +init: + expect: + pipeline: created + stages: + test: skipped + deploy: created + jobs: + test: manual + deploy: created + +transitions: [] + +# 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_test_manual_allow_failure_true_deploy_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_deploy_on_failure.yml new file mode 100644 index 00000000000..d375c6a49e0 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_manual_allow_failure_true_deploy_on_failure.yml @@ -0,0 +1,48 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + when: on_failure + script: exit 0 + needs: [test] + +init: + expect: + pipeline: created + stages: + test: skipped + 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: success + stages: + test: success + deploy: skipped + jobs: + test: failed + deploy: skipped + +# 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_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 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.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 new file mode 100644 index 00000000000..5ace621e89c --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_failure.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_test_on_failure_with_success.yml b/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.yml new file mode 100644 index 00000000000..19524cfd3e4 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/dag_test_on_failure_with_success.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/stage_build_allow_failure_test_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_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_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_fails.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails.yml new file mode 100644 index 00000000000..0618abf3524 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails.yml @@ -0,0 +1,38 @@ +config: + build: + stage: build + script: exit 1 + + test: + stage: test + 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: 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_allow_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml new file mode 100644 index 00000000000..362ac6e4239 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_build_fails_test_allow_failure.yml @@ -0,0 +1,39 @@ +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_test_manual_allow_failure_false.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_false.yml new file mode 100644 index 00000000000..2ffa35b56d7 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_false.yml @@ -0,0 +1,65 @@ +config: + test: + stage: test + when: manual + allow_failure: false + script: exit 0 + + deploy: + stage: deploy + script: exit 0 + +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: run + jobs: [test] + expect: + pipeline: running + stages: + test: running + deploy: created + jobs: + test: running + deploy: created + + - event: success + jobs: [test] + expect: + pipeline: running + stages: + test: success + deploy: pending + jobs: + test: success + deploy: pending + + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + test: success + deploy: success + jobs: + test: success + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true.yml new file mode 100644 index 00000000000..088fab5ca09 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true.yml @@ -0,0 +1,54 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + script: exit 0 + +init: + expect: + pipeline: pending + stages: + test: skipped + deploy: pending + jobs: + test: manual + deploy: pending + +transitions: + - event: success + jobs: [deploy] + expect: + pipeline: success + stages: + test: skipped + deploy: success + jobs: + test: manual + deploy: success + + - event: enqueue + jobs: [test] + expect: + pipeline: running + stages: + test: pending + deploy: success + jobs: + test: pending + deploy: success + + - event: drop + jobs: [test] + expect: + pipeline: success + stages: + test: success + deploy: success + jobs: + test: failed + deploy: success diff --git a/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_on_failure.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_on_failure.yml new file mode 100644 index 00000000000..2b30316aef6 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_manual_allow_failure_true_deploy_on_failure.yml @@ -0,0 +1,44 @@ +config: + test: + stage: test + when: manual + allow_failure: true + script: exit 1 + + deploy: + stage: deploy + when: on_failure + script: exit 0 + +init: + expect: + pipeline: skipped + stages: + test: skipped + deploy: skipped + jobs: + test: manual + deploy: skipped + +transitions: + - event: enqueue + jobs: [test] + expect: + pipeline: pending + stages: + test: pending + deploy: skipped + jobs: + test: pending + deploy: skipped + + - event: drop + jobs: [test] + expect: + pipeline: success + stages: + test: success + deploy: skipped + jobs: + test: failed + deploy: skipped 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 new file mode 100644 index 00000000000..1751cbb2023 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_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_test_on_failure_with_success.yml b/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.yml new file mode 100644 index 00000000000..15afe1ce8e1 --- /dev/null +++ b/spec/services/ci/pipeline_processing/test_cases/stage_test_on_failure_with_success.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 |