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
end
def ignored?
failed? && allow_failure?
allow_failure? && (failed? || canceled?)
end
def duration
......
......@@ -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),
......
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