Skip to content

Commit

Permalink
Localize depenencies in acceptance tests
Browse files Browse the repository at this point in the history
By specifying the dependencies on the resources, the chain is simpler.
This allows Java to be installed even if PostgreSQL fails. The benefit
is that it's easier to see in one go if things fail.
  • Loading branch information
ekohl committed Dec 29, 2020
1 parent 3adf6cb commit 66e3113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
10 changes: 3 additions & 7 deletions spec/acceptance/default_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ class { 'postgresql::server': }
}
class { 'jira':
version => '7.13.0',
javahome => '/usr',
version => '7.13.0',
javahome => '/usr',
require => [Class['java'], Postgresql::Server::Db['jira']],
}
class { 'jira::facts': }
Class['postgresql::server']
-> Postgresql::Server::Db['jira']
-> Class['java']
-> Class['jira']
EOS

apply_manifest(pp, catch_failures: true)
Expand Down
9 changes: 2 additions & 7 deletions spec/acceptance/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class { 'java':
private_key => '/tmp/key.pem',
target => '/tmp/jira.ks',
password => 'changeit',
require => Exec['tmpkey'],
}
class { 'jira':
Expand All @@ -45,16 +46,10 @@ class { 'jira':
tomcat_port => '8081',
tomcat_native_ssl => true,
tomcat_keystore_file => '/tmp/jira.ks',
require => [Mysql::Db['jira'], Java_ks['jira']],
}
class { 'jira::facts': }
Class['mysql::server']
-> Mysql::Db['jira']
-> Class['java']
-> Exec['tmpkey']
-> Java_ks['jira']
-> Class['jira']
EOS

apply_manifest(pp, catch_failures: true)
Expand Down

0 comments on commit 66e3113

Please sign in to comment.