2015-10-15 09:08:31 -04:00
|
|
|
module Ci
|
|
|
|
class Status
|
|
|
|
def self.get_status(statuses)
|
|
|
|
if statuses.none?
|
|
|
|
'skipped'
|
2016-02-18 05:47:35 -05:00
|
|
|
elsif statuses.all? { |status| status.success? || status.ignored? }
|
2015-10-15 09:08:31 -04:00
|
|
|
'success'
|
|
|
|
elsif statuses.all?(&:pending?)
|
|
|
|
'pending'
|
|
|
|
elsif statuses.any?(&:running?) || statuses.any?(&:pending?)
|
|
|
|
'running'
|
|
|
|
elsif statuses.all?(&:canceled?)
|
|
|
|
'canceled'
|
|
|
|
else
|
|
|
|
'failed'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-10-15 19:44:15 -04:00
|
|
|
end
|