Fix pipeline status for transition between stages
This commit is contained in:
parent
9bfff603fe
commit
f441b95bb3
2 changed files with 9 additions and 0 deletions
|
@ -31,6 +31,7 @@ module HasStatus
|
||||||
WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending'
|
WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending'
|
||||||
WHEN (#{running})+(#{pending})>0 THEN 'running'
|
WHEN (#{running})+(#{pending})>0 THEN 'running'
|
||||||
WHEN (#{manual})>0 THEN 'manual'
|
WHEN (#{manual})>0 THEN 'manual'
|
||||||
|
WHEN (#{created})>0 THEN 'running'
|
||||||
ELSE 'failed'
|
ELSE 'failed'
|
||||||
END)"
|
END)"
|
||||||
end
|
end
|
||||||
|
|
|
@ -110,6 +110,14 @@ describe HasStatus do
|
||||||
it { is_expected.to eq 'running' }
|
it { is_expected.to eq 'running' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when pipeline is in transition between stages' do
|
||||||
|
let!(:statuses) do
|
||||||
|
[create(type, status: :success), create(type, status: :created)]
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to eq 'running' }
|
||||||
|
end
|
||||||
|
|
||||||
context 'when one status is a blocking manual action' do
|
context 'when one status is a blocking manual action' do
|
||||||
let!(:statuses) do
|
let!(:statuses) do
|
||||||
[create(type, status: :failed),
|
[create(type, status: :failed),
|
||||||
|
|
Loading…
Reference in a new issue