summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-08-28 11:14:23 +0000
committerRémy Coutable <remy@rymai.me>2019-08-28 11:14:23 +0000
commite8bcabb4a735ecb84b5bc65269fffc21a72b6da6 (patch)
tree3048d28f54da0a90b096401c4e81d578972960a4 /spec
parenta3b462e92a94f8647e00d3a8abe490b77f3b45ed (diff)
parent2022e6799bcbf119ea80145e4993ffdb7bb108e3 (diff)
downloadgitlab-ce-e8bcabb4a735ecb84b5bc65269fffc21a72b6da6.tar.gz
Merge branch 'sh-lfs-object-batches' into 'master'
Makes LFS object link process OIDs in batches Closes #66274 See merge request gitlab-org/gitlab-ce!32268
Diffstat (limited to 'spec')
-rw-r--r--spec/services/projects/lfs_pointers/lfs_link_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/projects/lfs_pointers/lfs_link_service_spec.rb b/spec/services/projects/lfs_pointers/lfs_link_service_spec.rb
index 849601c4a63..66233787d3a 100644
--- a/spec/services/projects/lfs_pointers/lfs_link_service_spec.rb
+++ b/spec/services/projects/lfs_pointers/lfs_link_service_spec.rb
@@ -30,5 +30,23 @@ describe Projects::LfsPointers::LfsLinkService do
expect(subject.execute(new_oid_list.keys)).to eq linked
end
+
+ it 'links in batches' do
+ stub_const("#{described_class}::BATCH_SIZE", 3)
+
+ expect(Gitlab::Import::Logger)
+ .to receive(:info)
+ .with(class: described_class.name,
+ project_id: project.id,
+ project_path: project.full_path,
+ lfs_objects_linked_count: 7,
+ iterations: 3)
+
+ lfs_objects = create_list(:lfs_object, 7)
+ linked = subject.execute(lfs_objects.pluck(:oid))
+
+ expect(project.all_lfs_objects.count).to eq 9
+ expect(linked.size).to eq 7
+ end
end
end