Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-03-27 14:58:57 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2017-03-27 14:58:57 +0300
commit856d29918b089cf56b0cf590c46eb559627d39ce (patch)
tree356caa977f8cf4eeac33dab732152cd5c2a2bdb9 /spec
parenta5647149756735161dedf2afe71058d9aa0e0105 (diff)
parent414de2cf1407b73b0361220cf1fa55ab8cbdd7a1 (diff)
Merge branch 'fix/gb/pipeline-retry-only-latest-jobs' into 'master'
Do not retry jobs multiple times when retrying a pipeline Closes #30092 See merge request !10249
Diffstat (limited to 'spec')
-rw-r--r--spec/services/ci/retry_pipeline_service_spec.rb13
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)