diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-04 00:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-04 00:09:39 +0300 |
commit | 879876325f48fd3ec97f2a4f99a52fb0b1a9b8df (patch) | |
tree | dfede1226840209d8c6cdf61177cceed48cadef2 /spec | |
parent | b63f3afa42a43e2a261a989f87e9ccd1e18caaa5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/runtime_spec.rb | 13 | ||||
-rw-r--r-- | spec/requests/api/internal/base_spec.rb | 26 |
2 files changed, 35 insertions, 4 deletions
diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb index 34a775fc206..8f920bb2e01 100644 --- a/spec/lib/gitlab/runtime_spec.rb +++ b/spec/lib/gitlab/runtime_spec.rb @@ -105,4 +105,17 @@ describe Gitlab::Runtime do it_behaves_like "valid runtime", :rails_runner, 1 end + + context "action_cable" do + before do + stub_const('ACTION_CABLE_SERVER', true) + stub_const('::Puma', Module.new) + + allow(Gitlab::Application).to receive_message_chain(:config, :action_cable, :worker_pool_size).and_return(8) + end + + it "reports its maximum concurrency based on ActionCable's worker pool size" do + expect(subject.max_threads).to eq(9) + end + end end diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb index 7f7c81abda8..943fd477ed1 100644 --- a/spec/requests/api/internal/base_spec.rb +++ b/spec/requests/api/internal/base_spec.rb @@ -441,10 +441,11 @@ describe API::Internal::Base do allow(Gitlab::CurrentSettings).to receive(:receive_max_input_size) { 1 } end - it 'returns custom git config' do + it 'returns maxInputSize and partial clone git config' do push(key, project) expect(json_response["git_config_options"]).to be_present + expect(json_response["git_config_options"]).to include("receive.maxInputSize=1048576") expect(json_response["git_config_options"]).to include("uploadpack.allowFilter=true") expect(json_response["git_config_options"]).to include("uploadpack.allowAnySHA1InWant=true") end @@ -454,10 +455,11 @@ describe API::Internal::Base do stub_feature_flags(gitaly_upload_pack_filter: { enabled: false, thing: project }) end - it 'does not include allowFilter and allowAnySha1InWant in the git config options' do + it 'returns only maxInputSize and not partial clone git config' do push(key, project) expect(json_response["git_config_options"]).to be_present + expect(json_response["git_config_options"]).to include("receive.maxInputSize=1048576") expect(json_response["git_config_options"]).not_to include("uploadpack.allowFilter=true") expect(json_response["git_config_options"]).not_to include("uploadpack.allowAnySHA1InWant=true") end @@ -465,12 +467,28 @@ describe API::Internal::Base do end context 'when receive_max_input_size is empty' do - it 'returns an empty git config' do + before do allow(Gitlab::CurrentSettings).to receive(:receive_max_input_size) { nil } + end + it 'returns partial clone git config' do push(key, project) - expect(json_response["git_config_options"]).to be_empty + expect(json_response["git_config_options"]).to be_present + expect(json_response["git_config_options"]).to include("uploadpack.allowFilter=true") + expect(json_response["git_config_options"]).to include("uploadpack.allowAnySHA1InWant=true") + end + + context 'when gitaly_upload_pack_filter feature flag is disabled' do + before do + stub_feature_flags(gitaly_upload_pack_filter: { enabled: false, thing: project }) + end + + it 'returns an empty git config' do + push(key, project) + + expect(json_response["git_config_options"]).to be_empty + end end end end |