summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-07-28 17:03:17 +0000
committerRobert Speicher <robert@gitlab.com>2017-07-28 17:03:17 +0000
commit0bb58ff88576f2483110fed5c0d6631aada4b8df (patch)
treee93b57f109c17d8c4d7557ed7c2e0e1d63248822 /spec
parent8b68b69572cf2aa47ba497c119470131085f95f0 (diff)
parent0e355e5c9293c712b5df65896371af0ba71c19b2 (diff)
downloadgitlab-ce-0bb58ff88576f2483110fed5c0d6631aada4b8df.tar.gz
Merge branch 'dm-large-push-performance' into 'master'
Load and process at most 100 commits when pushing into default branch Closes #35531 See merge request !13132
Diffstat (limited to 'spec')
-rw-r--r--spec/services/git_push_service_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb
index 4023c33aa59..3fb677b65be 100644
--- a/spec/services/git_push_service_spec.rb
+++ b/spec/services/git_push_service_spec.rb
@@ -658,8 +658,7 @@ describe GitPushService, services: true do
end
it 'only schedules a limited number of commits' do
- allow(service).to receive(:push_commits)
- .and_return(Array.new(1000, double(:commit, to_hash: {}, matches_cross_reference_regex?: true)))
+ service.push_commits = Array.new(1000, double(:commit, to_hash: {}, matches_cross_reference_regex?: true))
expect(ProcessCommitWorker).to receive(:perform_async).exactly(100).times
@@ -667,8 +666,7 @@ describe GitPushService, services: true do
end
it "skips commits which don't include cross-references" do
- allow(service).to receive(:push_commits)
- .and_return([double(:commit, to_hash: {}, matches_cross_reference_regex?: false)])
+ service.push_commits = [double(:commit, to_hash: {}, matches_cross_reference_regex?: false)]
expect(ProcessCommitWorker).not_to receive(:perform_async)