Skip to content
Snippets Groups Projects
Commit bb9d360c authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch 'mark-legacy-git-access' into 'master'

Route path lookups through legacy_disk_path

See merge request gitlab-org/gitlab-ce!17743
parents 963e445f 008a6a6c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -225,7 +225,7 @@ module TestEnv
end
 
def repos_path
Gitlab.config.repositories.storages.default['path']
Gitlab.config.repositories.storages.default.legacy_disk_path
end
 
def backup_path
Loading
Loading
Loading
Loading
@@ -195,14 +195,23 @@ describe 'gitlab:app namespace rake task' do
end
 
context 'multiple repository storages' do
let(:gitaly_address) { Gitlab.config.repositories.storages.default.gitaly_address }
let(:storage_default) do
Gitlab::GitalyClient::StorageSettings.new(@default_storage_hash.merge('path' => 'tmp/tests/default_storage'))
end
let(:test_second_storage) do
Gitlab::GitalyClient::StorageSettings.new(@default_storage_hash.merge('path' => 'tmp/tests/custom_storage'))
end
let(:storages) do
{
'default' => { 'path' => Settings.absolute('tmp/tests/default_storage'), 'gitaly_address' => gitaly_address },
'test_second_storage' => { 'path' => Settings.absolute('tmp/tests/custom_storage'), 'gitaly_address' => gitaly_address }
'default' => storage_default,
'test_second_storage' => test_second_storage
}
end
 
before(:all) do
@default_storage_hash = Gitlab.config.repositories.storages.default.to_h
end
before do
# We only need a backup of the repositories for this test
stub_env('SKIP', 'db,uploads,builds,artifacts,lfs,registry')
Loading
Loading
Loading
Loading
@@ -6,13 +6,16 @@ describe 'gitlab:cleanup rake tasks' do
end
 
describe 'cleanup' do
let(:gitaly_address) { Gitlab.config.repositories.storages.default.gitaly_address }
let(:storages) do
{
'default' => { 'path' => Settings.absolute('tmp/tests/default_storage'), 'gitaly_address' => gitaly_address }
'default' => Gitlab::GitalyClient::StorageSettings.new(@default_storage_hash.merge('path' => 'tmp/tests/default_storage'))
}
end
 
before(:all) do
@default_storage_hash = Gitlab.config.repositories.storages.default.to_h
end
before do
FileUtils.mkdir(Settings.absolute('tmp/tests/default_storage'))
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
Loading
Loading
require 'rake_helper'
 
describe 'gitlab:git rake tasks' do
before(:all) do
@default_storage_hash = Gitlab.config.repositories.storages.default.to_h
end
before do
Rake.application.rake_require 'tasks/gitlab/git'
storages = { 'default' => { 'path' => Settings.absolute('tmp/tests/default_storage') } }
storages = { 'default' => Gitlab::GitalyClient::StorageSettings.new(@default_storage_hash.merge('path' => 'tmp/tests/default_storage')) }
 
FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@hashed/1/2/test.git'))
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
Loading
Loading
Loading
Loading
@@ -99,14 +99,14 @@ describe 'gitlab:gitaly namespace rake task' do
describe 'storage_config' do
it 'prints storage configuration in a TOML format' do
config = {
'default' => {
'default' => Gitlab::GitalyClient::StorageSettings.new(
'path' => '/path/to/default',
'gitaly_address' => 'unix:/path/to/my.socket'
},
'nfs_01' => {
),
'nfs_01' => Gitlab::GitalyClient::StorageSettings.new(
'path' => '/path/to/nfs_01',
'gitaly_address' => 'unix:/path/to/my.socket'
}
)
}
allow(Gitlab.config.repositories).to receive(:storages).and_return(config)
allow(Rails.env).to receive(:test?).and_return(false)
Loading
Loading
@@ -134,7 +134,7 @@ describe 'gitlab:gitaly namespace rake task' do
 
parsed_output = TomlRB.parse(expected_output)
config.each do |name, params|
expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] })
expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params.legacy_disk_path })
end
end
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe 'gitlab:shell rake tasks' do
it 'invokes create_hooks task' do
expect(Rake::Task['gitlab:shell:create_hooks']).to receive(:invoke)
 
storages = Gitlab.config.repositories.storages.values.map { |rs| rs['path'] }
storages = Gitlab.config.repositories.storages.values.map(&:legacy_disk_path)
expect(Kernel).to receive(:system).with('bin/install', *storages).and_call_original
expect(Kernel).to receive(:system).with('bin/compile').and_call_original
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment