Commit 3d38e461 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Support skipped status

parent 9e68109f
...@@ -12,12 +12,14 @@ module CiStatus ...@@ -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 ...@@ -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 ...@@ -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
......
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