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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-25 12:10:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-25 12:10:54 +0300
commit686c2375e1c9c559e3e7e04a8fbfbdafd9671932 (patch)
treedff32f6ef5167e1fb515b9406e0dfbee1ec4d1fb /spec/workers/ci
parenta1668610f7dbeb969f8e284bcbbff432d129bffd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/ci')
-rw-r--r--spec/workers/ci/initial_pipeline_process_worker_spec.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/workers/ci/initial_pipeline_process_worker_spec.rb b/spec/workers/ci/initial_pipeline_process_worker_spec.rb
index 5db9287fe96..bb144a3c360 100644
--- a/spec/workers/ci/initial_pipeline_process_worker_spec.rb
+++ b/spec/workers/ci/initial_pipeline_process_worker_spec.rb
@@ -4,17 +4,33 @@ require 'spec_helper'
RSpec.describe Ci::InitialPipelineProcessWorker do
describe '#perform' do
- let_it_be(:pipeline) { create(:ci_pipeline, :with_job, status: :created) }
+ let_it_be_with_reload(:pipeline) do
+ create(:ci_pipeline, :with_job, status: :created)
+ end
include_examples 'an idempotent worker' do
let(:job_args) { pipeline.id }
- it 'marks the pipeline as pending' do
+ context 'when there are runners available' do
+ before do
+ create(:ci_runner, :online)
+ end
+
+ it 'marks the pipeline as pending' do
+ expect(pipeline).to be_created
+
+ subject
+
+ expect(pipeline.reload).to be_pending
+ end
+ end
+
+ it 'marks the pipeline as failed' do
expect(pipeline).to be_created
subject
- expect(pipeline.reload).to be_pending
+ expect(pipeline.reload).to be_failed
end
end
end