Commit 26ba46d2 authored by Stan Hu's avatar Stan Hu

Add spec for Geo download instrumentation

parent 963d48fa
......@@ -98,14 +98,22 @@ describe Geo::FileDownloadService do
subject { described_class.new(:lfs, lfs_object.id) }
it 'downloads an LFS object' do
before do
allow_any_instance_of(Gitlab::ExclusiveLease)
.to receive(:try_obtain).and_return(true)
allow_any_instance_of(Gitlab::Geo::LfsTransfer)
.to receive(:download_from_primary).and_return(100)
end
it 'downloads an LFS object' do
expect { subject.execute }.to change { Geo::FileRegistry.count }.by(1)
end
it 'logs a message' do
expect(Gitlab::Geo::Logger).to receive(:info).with(hash_including(:message, :download_time_s, success: true, bytes_downloaded: 100)).and_call_original
subject.execute
end
end
context 'bad object type' do
......
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