Commit 47660596 authored by Nick Thomas's avatar Nick Thomas

Remove Gitlab::ShellAdapter from RepositoryUpdateMirrorWorker

parent 0c05d8b8
......@@ -7,7 +7,6 @@ class RepositoryUpdateMirrorWorker
idempotent!
data_consistency :always
include Gitlab::ShellAdapter
include ProjectStartImport
feature_category :source_code_management
......
......@@ -8,8 +8,10 @@ RSpec.describe RepositoryUpdateMirrorWorker do
let!(:project) { create(:project) }
let!(:import_state) { create(:import_state, :mirror, :scheduled, project: project) }
subject(:worker) { described_class.new }
before do
allow(subject).to receive(:jid).and_return(jid)
allow(worker).to receive(:jid).and_return(jid)
end
it 'sets status as finished when update mirror service executes successfully' do
......@@ -58,5 +60,15 @@ RSpec.describe RepositoryUpdateMirrorWorker do
expect { subject.perform(started_project.id) }.to change { import_state.reload.status }.to('finished')
end
end
it_behaves_like 'an idempotent worker' do
let(:job_args) { [project.id] }
before do
allow_next_instance_of(Projects::UpdateMirrorService) do |instance|
allow(instance).to receive(:execute).and_return(status: :success)
end
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