Commit f728e4b5 authored by Kamil Trzciński's avatar Kamil Trzciński

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
parents 9392e137 573c8d56
...@@ -45,6 +45,7 @@ v 8.6.0 (unreleased) ...@@ -45,6 +45,7 @@ v 8.6.0 (unreleased)
- Create external users which are excluded of internal and private projects unless access was explicitly granted - Create external users which are excluded of internal and private projects unless access was explicitly granted
- Continue parameters are checked to ensure redirection goes to the same instance - Continue parameters are checked to ensure redirection goes to the same instance
- User deletion is now done in the background so the request can not time out - User deletion is now done in the background so the request can not time out
- Canceled builds are now ignored in compound build status if marked as `allowed to fail`
v 8.5.7 v 8.5.7
- Bump Git version requirement to 2.7.3 - Bump Git version requirement to 2.7.3
......
...@@ -114,7 +114,7 @@ class CommitStatus < ActiveRecord::Base ...@@ -114,7 +114,7 @@ class CommitStatus < ActiveRecord::Base
end end
def ignored? def ignored?
failed? && allow_failure? allow_failure? && (failed? || canceled?)
end end
def duration def duration
......
...@@ -48,6 +48,29 @@ describe Ci::Status do ...@@ -48,6 +48,29 @@ describe Ci::Status do
it { is_expected.to eq 'success' } it { is_expected.to eq 'success' }
end 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 context 'one finished and second running but allowed to fail' do
let(:statuses) do let(:statuses) do
[create(type, status: :success), [create(type, status: :success),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment