2015-10-24 18:46:33 +05:30
|
|
|
module Ci
|
|
|
|
class Status
|
|
|
|
def self.get_status(statuses)
|
|
|
|
if statuses.none?
|
|
|
|
'skipped'
|
2016-04-02 18:10:28 +05:30
|
|
|
elsif statuses.all? { |status| status.success? || status.ignored? }
|
2015-10-24 18:46:33 +05:30
|
|
|
'success'
|
|
|
|
elsif statuses.all?(&:pending?)
|
|
|
|
'pending'
|
|
|
|
elsif statuses.any?(&:running?) || statuses.any?(&:pending?)
|
|
|
|
'running'
|
|
|
|
elsif statuses.all?(&:canceled?)
|
|
|
|
'canceled'
|
|
|
|
else
|
|
|
|
'failed'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|