diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 20:30:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 20:30:02 +0000 |
commit | 5b58da72d28361e659640a7c40372fbd72560e31 (patch) | |
tree | ff4ec4bfa169f10fe5ea525903f93004c57505b1 /spec/services/ci/retry_job_service_spec.rb | |
parent | 125e519c15ece1361000fcdb8379cb40329b33fd (diff) | |
download | gitlab-ce-5b58da72d28361e659640a7c40372fbd72560e31.tar.gz |
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
Diffstat (limited to 'spec/services/ci/retry_job_service_spec.rb')
-rw-r--r-- | spec/services/ci/retry_job_service_spec.rb | 15 |
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) |