diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-03-17 18:51:11 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-03-17 18:51:11 +0300 |
commit | f728e4b519bc153534dc9632aa37932e2ac24801 (patch) | |
tree | ad34a55d73796efbadf9ea747aed7db0db9dd2e4 /spec | |
parent | 9392e1375cdd65fe4a0a53ee12691aed94e25138 (diff) | |
parent | 573c8d561f369e8ceac21787a66df42d214bbecf (diff) |
Merge branch 'glalonde-triggerbuild' into 'master'
Adjusted behavior so canceled builds tagged as allowed to fail do not fail build
## What does this MR do?
This diff changes the 'Allowed to fail' flag to also ignore canceled builds, whereas before, canceled builds could fail the suite even if they were marked as 'Allowed to fail'
dupe of !3258 to force a build
## Are there points in the code the reviewer needs to double check?
no
## Why was this MR needed?
Unexpected behavior as a user
## What are the relevant issue numbers?
## Screenshots (if relevant)
![whatisgoingon](/uploads/fcd7c8f3d8454bc730d7fd41eff59b31/whatisgoingon.png)
See merge request !3271
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), |