Skip to content
Snippets Groups Projects
Commit 21e4f26d02b0 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Remove Geo database settings only if some services are enabled

Changelog: fixed
parent e146c458914b
No related branches found
No related tags found
1 merge request!72Intermediate build for testing purposes
......@@ -43,4 +43,5 @@
dependent_services.each do |svc|
notifies :restart, omnibus_helper.restart_service_resource(svc) if omnibus_helper.should_notify?(svc)
end
only_if { node['gitlab']['gitlab-rails']['enable'] }
end
......@@ -24,7 +24,28 @@
end
context 'database.yml' do
it 'renders database.yml without geo database' do
expect(database_yml[:production].keys).not_to include(:geo)
shared_examples 'removes Geo database settings' do
it 'renders database.yml without geo database' do
expect(database_yml[:production].keys).not_to include(:geo)
end
context 'with geo database specified' do
before do
stub_gitlab_rb(
gitlab_rails: {
databases: {
geo: {
enable: true,
db_connect_timeout: 50
}
}
}
)
end
it 'renders database.yml without geo database' do
expect(database_yml[:production].keys).not_to include(:geo)
end
end
end
......@@ -29,6 +50,6 @@
end
context 'with geo database specified' do
context 'when gitlab_rails is enabled' do
before do
stub_gitlab_rb(
gitlab_rails: {
......@@ -32,13 +53,8 @@
before do
stub_gitlab_rb(
gitlab_rails: {
databases: {
geo: {
enable: true,
db_connect_timeout: 50
}
}
enable: true
}
)
end
......@@ -41,9 +57,31 @@
}
)
end
it 'renders database.yml without geo database' do
expect(database_yml[:production].keys).not_to include(:geo)
include_examples "removes Geo database settings"
end
context 'when geo-logcursor is enabled' do
before do
stub_gitlab_rb(
geo_logcursor: {
enable: true
}
)
end
include_examples "removes Geo database settings"
end
context 'when gitlab_rails and geo-logcursor are disabled' do
before do
stub_gitlab_rb(geo_postgresql: { enable: true },
gitlab_rails: { enable: false },
geo_logcursor: { enable: false })
end
it 'does not render the database.yml file' do
expect(chef_run).not_to create_templatesymlink('Removes the geo database settings from database.yml and create a symlink to Rails root')
end
end
end
......
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