diff options
author | Geoffrey Lalonde <glalonde@google.com> | 2016-03-17 17:54:56 +0300 |
---|---|---|
committer | Geoffrey Lalonde <glalonde@google.com> | 2016-03-17 17:55:10 +0300 |
commit | 4117c815df73ba80258ca472470735826c68753a (patch) | |
tree | 74d7ea81633a4044dac5620badd3690a8e2e98ed /spec | |
parent | 39fb836c482d653f540531215ccd60b327166651 (diff) |
adjusted behavior so canceled builds tagged as allowed to fail do not fail build
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/ci/status_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/ci/status_spec.rb b/spec/lib/ci/status_spec.rb index 1539720bb8d..47f3df6e3ce 100644 --- a/spec/lib/ci/status_spec.rb +++ b/spec/lib/ci/status_spec.rb @@ -48,6 +48,29 @@ describe Ci::Status do it { is_expected.to eq 'success' } end + context 'success and canceled' do + let(:statuses) do + [create(type, status: :success), create(type, status: :canceled)] + end + it { is_expected.to eq 'failed' } + end + + context 'all canceled' do + let(:statuses) do + [create(type, status: :canceled), create(type, status: :canceled)] + end + it { is_expected.to eq 'canceled' } + end + + context 'success and canceled but allowed to fail' do + let(:statuses) do + [create(type, status: :success), + create(type, status: :canceled, allow_failure: true)] + end + + it { is_expected.to eq 'success' } + end + context 'one finished and second running but allowed to fail' do let(:statuses) do [create(type, status: :success), |