Remove redundantly tested code
Remove code that is redundantly tested. This should not be tested here but in puppet-oslo where this logic resides. If we keep this and we do changes in puppet-oslo we will break these unit tests, this is something we need to sort out for all modules. Change-Id: Ifa2b2745a70b7ccd0db56d1b37f62c9f9ca8ddbc
This commit is contained in:
parent
8e600c3ec7
commit
07ce900bb7
|
@ -1,65 +1,63 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'ec2api::db' do
|
||||
on_supported_os(supported_os: OSDefaults.get_supported_os).each do |os,facts|
|
||||
shared_examples 'ec2api::db' do
|
||||
context 'with default parameters' do
|
||||
it { should contain_class('ec2api::deps') }
|
||||
|
||||
it { should contain_oslo__db('ec2api_config').with(
|
||||
:connection => 'sqlite:////var/lib/ec2api/ec2api.sqlite',
|
||||
:idle_timeout => '<SERVICE DEFAULT>',
|
||||
:min_pool_size => '<SERVICE DEFAULT>',
|
||||
:db_max_retries => '<SERVICE DEFAULT>',
|
||||
:max_retries => '<SERVICE DEFAULT>',
|
||||
:retry_interval => '<SERVICE DEFAULT>',
|
||||
:max_pool_size => '<SERVICE DEFAULT>',
|
||||
:max_overflow => '<SERVICE DEFAULT>',
|
||||
:pool_timeout => '<SERVICE DEFAULT>',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{
|
||||
:database_connection => 'sqlite:////path/to/my/db.sqlite',
|
||||
:database_idle_timeout => '1',
|
||||
:database_min_pool_size => '2',
|
||||
:database_db_max_retries => '-1',
|
||||
:database_max_retries => '3',
|
||||
:database_retry_interval => '4',
|
||||
:database_max_pool_size => '5',
|
||||
:database_max_overflow => '6',
|
||||
:database_pool_timeout => '7',
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_class('ec2api::deps') }
|
||||
|
||||
it { should contain_oslo__db('ec2api_config').with(
|
||||
:connection => 'sqlite:////path/to/my/db.sqlite',
|
||||
:idle_timeout => '1',
|
||||
:min_pool_size => '2',
|
||||
:db_max_retries => '-1',
|
||||
:max_retries => '3',
|
||||
:retry_interval => '4',
|
||||
:max_pool_size => '5',
|
||||
:max_overflow => '6',
|
||||
:pool_timeout => '7',
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
|
||||
let(:facts) { facts.merge! @default_facts }
|
||||
|
||||
describe 'with default parameters' do
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
|
||||
it { is_expected.to contain_class('ec2api::db') }
|
||||
|
||||
parameters = {
|
||||
:connection => 'sqlite:////var/lib/ec2api/ec2api.sqlite',
|
||||
:idle_timeout => '<SERVICE DEFAULT>',
|
||||
:min_pool_size => '<SERVICE DEFAULT>',
|
||||
:db_max_retries => '<SERVICE DEFAULT>',
|
||||
:max_retries => '<SERVICE DEFAULT>',
|
||||
:retry_interval => '<SERVICE DEFAULT>',
|
||||
:max_pool_size => '<SERVICE DEFAULT>',
|
||||
:max_overflow => '<SERVICE DEFAULT>',
|
||||
:pool_timeout => '<SERVICE DEFAULT>',
|
||||
}
|
||||
|
||||
it { is_expected.to contain_oslo__db('ec2api_config').with(parameters) }
|
||||
end
|
||||
|
||||
describe 'with custom parameters' do
|
||||
let(:params) do
|
||||
{
|
||||
:database_connection => 'sqlite:////path/to/my/db.sqlite',
|
||||
:database_idle_timeout => '1',
|
||||
:database_min_pool_size => '2',
|
||||
:database_db_max_retries => '-1',
|
||||
:database_max_retries => '3',
|
||||
:database_retry_interval => '4',
|
||||
:database_max_pool_size => '5',
|
||||
:database_max_overflow => '6',
|
||||
:database_pool_timeout => '6',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
|
||||
it { is_expected.to contain_class('ec2api::db') }
|
||||
|
||||
parameters = {
|
||||
:connection => 'sqlite:////path/to/my/db.sqlite',
|
||||
:idle_timeout => '1',
|
||||
:min_pool_size => '2',
|
||||
:db_max_retries => '-1',
|
||||
:max_retries => '3',
|
||||
:retry_interval => '4',
|
||||
:max_pool_size => '5',
|
||||
:max_overflow => '6',
|
||||
:pool_timeout => '6',
|
||||
}
|
||||
|
||||
it { is_expected.to contain_oslo__db('ec2api_config').with(parameters) }
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'ec2api::db'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue