Commit 97775de3 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents ddbc9d7b 266211b9
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
- pipeline_processing:ci_build_prepare - pipeline_processing:ci_build_prepare
- pipeline_processing:build_queue - pipeline_processing:build_queue
- pipeline_processing:build_success - pipeline_processing:build_success
- pipeline_processing:build_process
- pipeline_processing:pipeline_process - pipeline_processing:pipeline_process
- pipeline_processing:pipeline_success - pipeline_processing:pipeline_success
- pipeline_processing:pipeline_update - pipeline_processing:pipeline_update
......
# frozen_string_literal: true
class BuildProcessWorker
include ApplicationWorker
include PipelineQueue
queue_namespace :pipeline_processing
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
CommitStatus.find_by(id: build_id).try do |build|
build.pipeline.process!([build_id])
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
# frozen_string_literal: true
require 'spec_helper'
describe BuildProcessWorker do
describe '#perform' do
context 'when build exists' do
let(:pipeline) { create(:ci_pipeline) }
let(:build) { create(:ci_build, pipeline: pipeline) }
it 'processes build' do
expect_any_instance_of(Ci::Pipeline).to receive(:process!)
.with([build.id])
described_class.new.perform(build.id)
end
end
context 'when build does not exist' do
it 'does not raise exception' do
expect { described_class.new.perform(123) }
.not_to raise_error
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment