Commit 4117c815 authored by Geoffrey Lalonde's avatar Geoffrey Lalonde

adjusted behavior so canceled builds tagged as allowed to fail do not fail build

parent 39fb836c
...@@ -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