Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests to not test private classes #116

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Configuration for Candlepin
class candlepin::config {
assert_private()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do at runtime?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/puppetlabs/puppetlabs-stdlib#assert_private is not that clear, but essentially if you include candlepin::config from another module (such as katello) it'll raise an error. I'm not entirely sure about the second commit. Maybe just marking it as @api private in the docs is enough (#117) but this way we can easily revert it.


user { 'tomcat':
ensure => present,
Expand Down
2 changes: 2 additions & 0 deletions manifests/database/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
$db_password = $::candlepin::db_password,
$enable_hbm2ddl_validate = $::candlepin::enable_hbm2ddl_validate,
) {
assert_private()

concat::fragment{'Mysql Database Configuration':
target => $candlepin_conf_file,
content => template('candlepin/_candlepin_database.conf.erb'),
Expand Down
2 changes: 2 additions & 0 deletions manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
$log_dir = $::candlepin::log_dir,

) {
assert_private()

concat::fragment{'PostgreSQL Database Configuration':
target => $candlepin_conf_file,
content => template('candlepin/_candlepin_database.conf.erb'),
Expand Down
2 changes: 2 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Candlepin installation packages
class candlepin::install {
assert_private()

package { ['candlepin']:
ensure => $candlepin::version,
}
Expand Down
1 change: 1 addition & 0 deletions manifests/qpid.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Qpid setup for Candlepin
class candlepin::qpid {
assert_private()

if $::candlepin::amq_enable {
qpid::config::exchange { 'event':
Expand Down
7 changes: 3 additions & 4 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Candlepin Service and Initialization
class candlepin::service(
Boolean $run_init = $::candlepin::run_init,
) {
class candlepin::service {
assert_private()

service { 'tomcat':
ensure => running,
Expand All @@ -10,7 +9,7 @@
hasrestart => true,
}

if $run_init {
if $::candlepin::run_init {
exec { 'cpinit':
# tomcat startup is slow - try multiple times (the initialization service is idempotent)
command => '/usr/bin/wget --no-proxy --timeout=30 --tries=40 --wait=20 --retry-connrefused -qO- http://localhost:8080/candlepin/admin/init > /var/log/candlepin/cpinit.log 2>&1 && touch /var/lib/candlepin/cpinit_done',
Expand Down
139 changes: 0 additions & 139 deletions spec/classes/candlepin_config_spec.rb

This file was deleted.

57 changes: 0 additions & 57 deletions spec/classes/candlepin_database_mysql_spec.rb

This file was deleted.

60 changes: 0 additions & 60 deletions spec/classes/candlepin_database_postgresql_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/classes/candlepin_install_spec.rb

This file was deleted.

32 changes: 0 additions & 32 deletions spec/classes/candlepin_qpid_spec.rb

This file was deleted.

Loading