summaryrefslogtreecommitdiff
path: root/spec/services/ci/retry_job_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/ci/retry_job_service_spec.rb')
-rw-r--r--spec/services/ci/retry_job_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/ci/retry_job_service_spec.rb b/spec/services/ci/retry_job_service_spec.rb
index 10acf032b1a..fed66bc535d 100644
--- a/spec/services/ci/retry_job_service_spec.rb
+++ b/spec/services/ci/retry_job_service_spec.rb
@@ -356,6 +356,21 @@ RSpec.describe Ci::RetryJobService, feature_category: :continuous_integration do
it_behaves_like 'retries the job'
+ context 'automatic retryable build' do
+ let!(:auto_retryable_build) do
+ create(:ci_build, pipeline: pipeline, ci_stage: stage, user: user, options: { retry: 1 })
+ end
+
+ def drop_build!
+ auto_retryable_build.drop_with_exit_code!('test failure', 1)
+ end
+
+ it 'creates a new build and enqueues BuildQueueWorker' do
+ expect { drop_build! }.to change { Ci::Build.count }.by(1)
+ .and change { BuildQueueWorker.jobs.count }.by(1)
+ end
+ end
+
context 'when there are subsequent jobs that are skipped' do
let!(:subsequent_build) do
create(:ci_build, :skipped, pipeline: pipeline, ci_stage: deploy_stage)