Skip to content

Add two spec examples of canceled CI builds

Furkan Ayhan requested to merge fa/two-spec-examples-of-canceled-builds into master

What does this MR do and why?

This MR adds test cases for this;

(from the Slack thread)

The canceled and failed statuses sometimes behave the same, sometimes not...

  1. Both statuses are sometimes considered "failed". When a job is failed or canceled with allow_failure: true, we mark their stage/pipeline as "success with warning".

For this example;

build:
  stage: build
  script: sleep 10
  allow_failure: true

test:
  stage: test
  script: exit 0
  • If build is canceled, test runs.
  • If build is failed, test runs.
  1. Sometimes they are different. on_failure only looks for failed for the previous status, not canceled.

For this example;

build:
  stage: build
  script: sleep 10

test:
  stage: test
  script: exit 0
  when: on_failure
  • If build is canceled, test is skipped.
  • If build is failed, test runs.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Furkan Ayhan

Merge request reports