diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-27 09:11:29 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-27 09:11:29 +0200 |
commit | 8c59489c93cf4dec8f4b2abf4ad65ee647c00b3a (patch) | |
tree | a1e723f9984e618ef408f80b702d26bb857a5509 /spec/services | |
parent | c848735db6e77b7400ea88f9286bb12ff840a318 (diff) | |
download | gitlab-ce-8c59489c93cf4dec8f4b2abf4ad65ee647c00b3a.tar.gz |
Do not retry jobs multiple times when retrying a pipeline
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 5445b65f4e8..f1b2d3a4798 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -9,6 +9,19 @@ describe Ci::RetryPipelineService, '#execute', :services do context 'when user has ability to modify pipeline' do let(:user) { create(:admin) } + context 'when there are already retried jobs present' do + before do + create_build('rspec', :canceled, 0) + create_build('rspec', :failed, 0) + end + + it 'does not retry jobs that has already been retried' do + expect(statuses.first).to be_retried + expect { service.execute(pipeline) } + .to change { CommitStatus.count }.by(1) + end + end + context 'when there are failed builds in the last stage' do before do create_build('rspec 1', :success, 0) |