Merge branch 'fix/gb/pipeline-intermittent-running-status' into 'master'
Fix pipeline status for transition between stages Closes #29699 See merge request !10094
This commit is contained in:
commit
46146e33f2
|
@ -31,6 +31,7 @@ module HasStatus
|
|||
WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending'
|
||||
WHEN (#{running})+(#{pending})>0 THEN 'running'
|
||||
WHEN (#{manual})>0 THEN 'manual'
|
||||
WHEN (#{created})>0 THEN 'running'
|
||||
ELSE 'failed'
|
||||
END)"
|
||||
end
|
||||
|
|
|
@ -110,6 +110,24 @@ describe HasStatus do
|
|||
it { is_expected.to eq 'running' }
|
||||
end
|
||||
|
||||
context 'when one status finished and second is still created' do
|
||||
let!(:statuses) do
|
||||
[create(type, status: :success), create(type, status: :created)]
|
||||
end
|
||||
|
||||
it { is_expected.to eq 'running' }
|
||||
end
|
||||
|
||||
context 'when there is a manual status before created status' do
|
||||
let!(:statuses) do
|
||||
[create(type, status: :success),
|
||||
create(type, status: :manual, allow_failure: false),
|
||||
create(type, status: :created)]
|
||||
end
|
||||
|
||||
it { is_expected.to eq 'manual' }
|
||||
end
|
||||
|
||||
context 'when one status is a blocking manual action' do
|
||||
let!(:statuses) do
|
||||
[create(type, status: :failed),
|
||||
|
|
Loading…
Reference in New Issue