Fix pipeline status when allowed to fail jobs present

This commit is contained in:
Grzegorz Bizon 2017-05-08 12:47:21 +02:00
parent bf57a7e80c
commit 64e09a1b35
2 changed files with 7 additions and 1 deletions

View File

@ -37,7 +37,9 @@ module HasStatus
end
def status
all.pluck(status_sql).first
all.pluck(status_sql).first.tap do |status|
return 'success' if status == 'skipped' && all.failed_but_allowed.any?
end
end
def started_at

View File

@ -62,6 +62,10 @@ describe Ci::ProcessPipelineService, '#execute', :services do
fail_running_or_pending
expect(builds_statuses).to eq %w(failed pending)
fail_running_or_pending
expect(pipeline.reload).to be_success
end
end