Commit 266211b9 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'remove-build-process-worker' into 'master'

Remove unused `BuildProcessWorker`

Closes #65539

See merge request gitlab-org/gitlab-ce!31756
parents 3770f3fb 1438119d
...@@ -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