Commit 47660596 authored by Nick Thomas's avatar Nick Thomas

Remove Gitlab::ShellAdapter from RepositoryUpdateMirrorWorker

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