Commit fd4fd0cb authored by Kamil Trzciński's avatar Kamil Trzciński

Fix failures

parent 1a13188d
......@@ -10,7 +10,8 @@ module HasStatus
ACTIVE_STATUSES = %w[preparing pending running].freeze
COMPLETED_STATUSES = %w[success failed canceled skipped].freeze
ORDERED_STATUSES = %w[failed preparing pending running manual scheduled canceled success skipped created].freeze
WARNING_STATUSES = %w[manual failed canceled].to_set.freeze
WARNING_IF_ALLOW_FAILURE_STATUSES = %w[manual failed canceled].to_set.freeze
IGNORED_IF_ALLOW_FAILURE_STATUSES = %w[failed canceled].to_set.freeze
STATUSES_ENUM = { created: 0, pending: 1, running: 2, success: 3,
failed: 4, canceled: 5, skipped: 6, manual: 7,
scheduled: 8, preparing: 9 }.freeze
......
......@@ -15,9 +15,7 @@ module Gitlab
def status
case
when none?
:skipped
when only_of?(:skipped)
when none? || only_of?(:skipped)
warnings? ? :success : :skipped
when only_of?(:success, :skipped)
:success
......@@ -65,9 +63,11 @@ module Gitlab
def build_status_set(all_statuses)
all_statuses.each do |status|
if status[:allow_failure] && HasStatus::WARNING_STATUSES.include?(status[:status])
if status[:allow_failure] && HasStatus::WARNING_IF_ALLOW_FAILURE_STATUSES.include?(status[:status])
@warnings += 1
else
end
if !status[:allow_failure] || !HasStatus::IGNORED_IF_ALLOW_FAILURE_STATUSES.include?(status[:status])
@status_set.add(status[:status].to_sym)
end
end
......
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