Support skipped status
This commit is contained in:
parent
9e68109f2d
commit
3d38e46191
2 changed files with 4 additions and 1 deletions
|
@ -12,12 +12,14 @@ module CiStatus
|
||||||
pending = all.pending.select('count(*)').to_sql
|
pending = all.pending.select('count(*)').to_sql
|
||||||
running = all.running.select('count(*)').to_sql
|
running = all.running.select('count(*)').to_sql
|
||||||
canceled = all.canceled.select('count(*)').to_sql
|
canceled = all.canceled.select('count(*)').to_sql
|
||||||
|
skipped = all.skipped.select('count(*)').to_sql
|
||||||
|
|
||||||
deduce_status = "(CASE
|
deduce_status = "(CASE
|
||||||
WHEN (#{builds})=0 THEN 'skipped'
|
WHEN (#{builds})=0 THEN 'skipped'
|
||||||
WHEN (#{builds})=(#{success})+(#{ignored}) THEN 'success'
|
WHEN (#{builds})=(#{success})+(#{ignored}) THEN 'success'
|
||||||
WHEN (#{builds})=(#{pending}) THEN 'pending'
|
WHEN (#{builds})=(#{pending}) THEN 'pending'
|
||||||
WHEN (#{builds})=(#{canceled}) THEN 'canceled'
|
WHEN (#{builds})=(#{canceled}) THEN 'canceled'
|
||||||
|
WHEN (#{builds})=(#{skipped}) THEN 'skipped'
|
||||||
WHEN (#{running})+(#{pending})>0 THEN 'running'
|
WHEN (#{running})+(#{pending})>0 THEN 'running'
|
||||||
ELSE 'failed'
|
ELSE 'failed'
|
||||||
END)"
|
END)"
|
||||||
|
@ -52,6 +54,7 @@ module CiStatus
|
||||||
scope :success, -> { where(status: 'success') }
|
scope :success, -> { where(status: 'success') }
|
||||||
scope :failed, -> { where(status: 'failed') }
|
scope :failed, -> { where(status: 'failed') }
|
||||||
scope :canceled, -> { where(status: 'canceled') }
|
scope :canceled, -> { where(status: 'canceled') }
|
||||||
|
scope :skipped, -> { where(status: 'skipped') }
|
||||||
scope :running_or_pending, -> { where(status: [:running, :pending]) }
|
scope :running_or_pending, -> { where(status: [:running, :pending]) }
|
||||||
scope :finished, -> { where(status: [:success, :failed, :canceled]) }
|
scope :finished, -> { where(status: [:success, :failed, :canceled]) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
|
||||||
end
|
end
|
||||||
|
|
||||||
step 'I should see "Shop" project CI status' do
|
step 'I should see "Shop" project CI status' do
|
||||||
expect(page).to have_link "Build skipped"
|
expect(page).to have_link "Build: skipped"
|
||||||
end
|
end
|
||||||
|
|
||||||
step 'I should see last push widget' do
|
step 'I should see last push widget' do
|
||||||
|
|
Loading…
Reference in a new issue