diff options
author | Rémy Coutable <remy@rymai.me> | 2019-08-28 11:14:23 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-08-28 11:14:23 +0000 |
commit | e8bcabb4a735ecb84b5bc65269fffc21a72b6da6 (patch) | |
tree | 3048d28f54da0a90b096401c4e81d578972960a4 /spec/services/projects | |
parent | a3b462e92a94f8647e00d3a8abe490b77f3b45ed (diff) | |
parent | 2022e6799bcbf119ea80145e4993ffdb7bb108e3 (diff) | |
download | gitlab-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/services/projects')
-rw-r--r-- | spec/services/projects/lfs_pointers/lfs_link_service_spec.rb | 18 |
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 |