Enable gitaly token auth when testing

This commit is contained in:
Jacob Vosmaer 2017-06-20 17:42:54 +02:00
parent 4f8af50b61
commit 218da88e1a
3 changed files with 5 additions and 2 deletions

View file

@ -599,6 +599,7 @@ test:
gitaly_address: unix:tmp/tests/gitaly/gitaly.socket
gitaly:
enabled: true
token: secret
backup:
path: tmp/tests/backups
gitlab_shell:

View file

@ -58,8 +58,9 @@ namespace :gitlab do
storages << { name: key, path: val['path'] }
end
TOML.dump(socket_path: address.sub(%r{\Aunix:}, ''), storage: storages)
config = { socket_path: address.sub(%r{\Aunix:}, ''), storage: storages }
config[:auth] = { token: 'secret' } if Rails.env.test?
TOML.dump(config)
end
def create_gitaly_configuration

View file

@ -89,6 +89,7 @@ describe 'gitlab:gitaly namespace rake task' do
}
}
allow(Gitlab.config.repositories).to receive(:storages).and_return(config)
allow(Rails.env).to receive(:test?).and_return(false)
expected_output = ''
Timecop.freeze do