-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split migration spec into separate files
Rather than having one huge migration spec file, this keeps it managable.
- Loading branch information
Showing
7 changed files
with
121 additions
and
115 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,11 @@ | ||
require 'spec_helper' | ||
|
||
migration '181213211252-merged-installer' do | ||
let(:config) { load_fixture_yaml('merged-installer', "#{scenario_name}-before.yaml") } | ||
|
||
scenarios %w[foreman-proxy-content katello] do | ||
it 'matches the scenario fixture' do | ||
expect(migrated_config).to eq load_fixture_yaml('merged-installer', "#{scenario_name}-after.yaml") | ||
end | ||
end | ||
end |
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,11 @@ | ||
require 'spec_helper' | ||
|
||
migration '200818160950-remove_tuning_fact' do | ||
scenarios %w[foreman-proxy-content] do | ||
let(:config) { super().merge(:facts => { 'tuning' => 'default' }) } | ||
|
||
it 'removes facts' do | ||
expect(migrated_config).not_to include(:facts) | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
spec/migrations/20210625142707_dynamic_puppet_in_foreman_groups_spec.rb
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,17 @@ | ||
require 'spec_helper' | ||
|
||
migration '20210625142707_dynamic_puppet_in_foreman_groups' do | ||
let(:answers) do | ||
{ | ||
'foreman' => { | ||
'user_groups' => ['puppet'], | ||
}, | ||
} | ||
end | ||
|
||
scenarios %w[foreman katello] do | ||
it 'removes puppet' do | ||
expect(migrated_answers['foreman']['user_groups']).to eq [] | ||
end | ||
end | ||
end |
28 changes: 28 additions & 0 deletions
28
spec/migrations/20210929144850_disable_puppet_plugins_if_undesired_spec.rb
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,28 @@ | ||
require 'spec_helper' | ||
|
||
migration '20210929144850_disable_puppet_plugins_if_undesired' do | ||
let(:answers) do | ||
{ | ||
'foreman' => false, | ||
'foreman::cli' => false, | ||
} | ||
end | ||
|
||
scenarios %w[foreman katello] do | ||
it 'keeps foreman::cli disabled' do | ||
expect(migrated_answers['foreman::cli']).to be false | ||
end | ||
|
||
it 'adds foreman::cli::puppet disabled' do | ||
expect(migrated_answers['foreman::cli::puppet']).to be false | ||
end | ||
|
||
it 'keeps foreman disabled' do | ||
expect(migrated_answers['foreman']).to be false | ||
end | ||
|
||
it 'adds foreman::plugin::puppet disabled' do | ||
expect(migrated_answers['foreman::plugin::puppet']).to be false | ||
end | ||
end | ||
end |
35 changes: 35 additions & 0 deletions
35
spec/migrations/20211108174119_disable_registration_without_templates_spec.rb
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,35 @@ | ||
require 'spec_helper' | ||
|
||
migration '20211108174119_disable_registration_without_templates' do | ||
scenarios %w[foreman foreman-proxy-content katello] do | ||
context 'with registration, without templates' do | ||
let(:answers) do | ||
{ | ||
'foreman_proxy' => { | ||
'registration' => true, | ||
'templates' => false, | ||
}, | ||
} | ||
end | ||
|
||
it 'disables registration' do | ||
expect(migrated_answers['foreman_proxy']['registration']).to be false | ||
end | ||
end | ||
|
||
context 'with registration, with templates' do | ||
let(:answers) do | ||
{ | ||
'foreman_proxy' => { | ||
'registration' => true, | ||
'templates' => true, | ||
}, | ||
} | ||
end | ||
|
||
it 'keeps registration enabled' do | ||
expect(migrated_answers['foreman_proxy']['registration']).to be true | ||
end | ||
end | ||
end | ||
end |
19 changes: 19 additions & 0 deletions
19
spec/migrations/20231005004305_redis_default_cache_spec.rb
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,19 @@ | ||
require 'spec_helper' | ||
|
||
migration '20231005004305_redis_default_cache' do | ||
scenarios %w[foreman katello] do | ||
context 'changes default cache to Redis' do | ||
let(:answers) do | ||
{ | ||
'foreman' => { | ||
'rails_cache_store' => { 'type' => 'file' }, | ||
}, | ||
} | ||
end | ||
|
||
it 'changes the default to Redis' do | ||
expect(migrated_answers['foreman']['rails_cache_store']).to eq({ 'type' => 'redis' }) | ||
end | ||
end | ||
end | ||
end |