Skip to content
Snippets Groups Projects
Commit 7102d9b7 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Split off repositories storages settings specs from gitlab-rails spec

parent 6ea08b26
No related branches found
No related tags found
3 merge requests!51Validate shift of Heptapod 0.25 to oldstable series,!47Making Heptapod 0.25 the new stable in Omnibus,!45GitLab 14.2
require 'chef_helper'
RSpec.describe 'gitlab::gitlab-rails' do
using RSpec::Parameterized::TableSyntax
include_context 'gitlab-rails'
describe 'repositories storages settings' do
context 'with default values' do
it 'renders gitlab.yml with default repository storage settings' do
expect(gitlab_yml[:production][:repositories][:storages]).to eq(
default: {
gitaly_address: 'unix:/var/opt/gitlab/gitaly/gitaly.socket',
path: '/var/opt/gitlab/git-data/repositories'
}
)
end
end
context 'with user specified values' do
before do
stub_gitlab_rb(
git_data_dirs: {
second_storage: {
path: '/tmp/foobar',
gitaly_address: 'unix:/var/gitaly.socket'
}
}
)
end
it 'renders gitlab.yml with specified repository storage settings' do
expect(gitlab_yml[:production][:repositories][:storages]).to eq(
second_storage: {
gitaly_address: 'unix:/var/gitaly.socket',
path: '/tmp/foobar/repositories'
}
)
end
context 'when path is not provided for a storage' do
before do
stub_gitlab_rb(
git_data_dirs: {
default: {
gitaly_address: 'unix:/var/gitaly.socket'
}
}
)
end
it 'sets the default path' do
expect(gitlab_yml[:production][:repositories][:storages]).to eq(
default: {
gitaly_address: 'unix:/var/gitaly.socket',
path: '/var/opt/gitlab/git-data/repositories'
}
)
end
end
end
end
end
......@@ -395,65 +395,6 @@
'clear the gitlab-rails cache')
end
end
describe 'repositories storages' do
it 'sets specified properties' do
stub_gitlab_rb(
git_data_dirs: {
"second_storage" => {
"path" => "/tmp/storage"
}
}
)
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'repositories_storages' => {
'second_storage' => {
'path' => '/tmp/storage/repositories',
'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket'
}
}
)
)
end
it 'sets the defaults' do
default_storages = {
'default' => {
'path' => '/var/opt/gitlab/git-data/repositories',
'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket'
}
}
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'repositories_storages' => default_storages
)
)
end
it 'sets path if not provided' do
stub_gitlab_rb(
{
git_data_dirs:
{
'default' => { 'gitaly_address' => 'tcp://gitaly.internal:8075' }
}
}
)
expect(chef_run).to create_templatesymlink('Create a gitlab.yml and create a symlink to Rails root').with_variables(
hash_including(
'repositories_storages' => {
'default' => {
'path' => '/var/opt/gitlab/git-data/repositories',
'gitaly_address' => 'tcp://gitaly.internal:8075'
}
}
)
)
end
end
end
context 'with environment variables' do
......
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