-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spec test to ensure correct behavior across PE versions
This spec test makes sure that the pg_repack class is included on versions of PE that support it and is not included on versions that do not support it.
- Loading branch information
Showing
2 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'spec_helper' | ||
|
||
describe 'pe_databases::maintenance' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:pre_condition) { "class { 'pe_databases': }" } | ||
let(:facts) { os_facts } | ||
|
||
it { is_expected.to compile } | ||
|
||
context 'on PE 2019.0.0' do | ||
before(:each) do | ||
facts['pe_server_version'] = '2019.0.0' | ||
end | ||
|
||
it { is_expected.to contain_class('pe_databases::maintenance::vacuum_full') } | ||
it { is_expected.not_to contain_class('pe_databases::maintenance::pg_repack') } | ||
end | ||
context 'on PE 2018.1.4' do | ||
before(:each) do | ||
facts['pe_server_version'] = '2018.1.4' | ||
end | ||
|
||
it { is_expected.to contain_class('pe_databases::maintenance::vacuum_full') } | ||
it { is_expected.not_to contain_class('pe_databases::maintenance::pg_repack') } | ||
end | ||
context 'on PE 2018.1.8' do | ||
before(:each) do | ||
facts['pe_server_version'] = '2018.1.9' | ||
end | ||
|
||
it { is_expected.to contain_class('pe_databases::maintenance::vacuum_full').with('disable_maintenance' => true) } | ||
it { is_expected.to contain_class('pe_databases::maintenance::pg_repack') } | ||
end | ||
context 'on PE 2019.0.3' do | ||
before(:each) do | ||
facts['pe_server_version'] = '2019.0.3' | ||
end | ||
|
||
it { is_expected.to contain_class('pe_databases::maintenance::vacuum_full').with('disable_maintenance' => true) } | ||
it { is_expected.to contain_class('pe_databases::maintenance::pg_repack') } | ||
end | ||
end | ||
end | ||
end |