summaryrefslogtreecommitdiff
path: root/spec/initializers
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2018-06-27 16:20:03 +0000
committerRémy Coutable <remy@rymai.me>2018-06-27 16:20:03 +0000
commit1142e2c32eb0c4f4040c13d40d73fb8f84f35628 (patch)
tree512a0ed100c24e1376c6457e248b1922e4a3f359 /spec/initializers
parent4f7dce769559f0fca2448e25417e5fef2b51df06 (diff)
downloadgitlab-ce-1142e2c32eb0c4f4040c13d40d73fb8f84f35628.tar.gz
Migrate storage nesting check to Gitaly
Diffstat (limited to 'spec/initializers')
-rw-r--r--spec/initializers/6_validations_spec.rb43
1 files changed, 0 insertions, 43 deletions
diff --git a/spec/initializers/6_validations_spec.rb b/spec/initializers/6_validations_spec.rb
index 8d9dc092547..f96e5a2133f 100644
--- a/spec/initializers/6_validations_spec.rb
+++ b/spec/initializers/6_validations_spec.rb
@@ -44,49 +44,6 @@ describe '6_validations' do
end
end
- describe 'validate_storages_paths' do
- context 'with correct settings' do
- before do
- mock_storages('foo' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/c'), 'bar' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/d'))
- end
-
- it 'passes through' do
- expect { validate_storages_paths }.not_to raise_error
- end
- end
-
- context 'with nested storage paths' do
- before do
- mock_storages('foo' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/c'), 'bar' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/c/d'))
- end
-
- it 'throws an error' do
- expect { validate_storages_paths }.to raise_error('bar is a nested path of foo. Nested paths are not supported for repository storages. Please fix this in your gitlab.yml before starting GitLab.')
- end
- end
-
- context 'with similar but un-nested storage paths' do
- before do
- mock_storages('foo' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/c'), 'bar' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/paths/a/b/c2'))
- end
-
- it 'passes through' do
- expect { validate_storages_paths }.not_to raise_error
- end
- end
-
- describe 'inaccessible storage' do
- before do
- mock_storages('foo' => Gitlab::GitalyClient::StorageSettings.new('path' => 'tmp/tests/a/path/that/does/not/exist'))
- end
-
- it 'passes through with a warning' do
- expect(Rails.logger).to receive(:error)
- expect { validate_storages_paths }.not_to raise_error
- end
- end
- end
-
def mock_storages(storages)
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
end