Do not update stage status when it is just created
This commit is contained in:
parent
0e1b3dc41b
commit
887818d3cb
|
@ -74,8 +74,7 @@ module Ci
|
|||
when 'failed' then drop
|
||||
when 'canceled' then cancel
|
||||
when 'manual' then block
|
||||
when 'skipped' then skip
|
||||
else skip
|
||||
when 'skipped', nil then skip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,7 +65,31 @@ describe Ci::Stage, :models do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when stage is skipped' do
|
||||
context 'when stage has only created builds' do
|
||||
let(:stage) { create(:ci_stage_entity, status: :created) }
|
||||
|
||||
before do
|
||||
create(:ci_build, :created, stage_id: stage.id)
|
||||
end
|
||||
|
||||
it 'updates status to skipped' do
|
||||
expect(stage.reload.status).to eq 'created'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when stage is skipped because of skipped builds' do
|
||||
before do
|
||||
create(:ci_build, :skipped, stage_id: stage.id)
|
||||
end
|
||||
|
||||
it 'updates status to skipped' do
|
||||
expect { stage.update_status }
|
||||
.to change { stage.reload.status }
|
||||
.to 'skipped'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when stage is skipped because is empty' do
|
||||
it 'updates status to skipped' do
|
||||
expect { stage.update_status }
|
||||
.to change { stage.reload.status }
|
||||
|
|
Loading…
Reference in New Issue