diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 23:27:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 23:27:29 +0300 |
commit | bdba353a06bc74629cf570f1cbe123cde8524d77 (patch) | |
tree | 3b27a38028112efdeb94107b3b0c76384a06e346 /spec | |
parent | c20ce49bdab650656be01968381f6ee1a5f96e7c (diff) |
Add latest changes from gitlab-org/gitlab@15-10-stable-ee
Diffstat (limited to 'spec')
-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) |