voxpupuli / puppet-rsyslog

Puppet module for managing rsyslog
https://forge.puppet.com/puppet/rsyslog
Apache License 2.0
10 stars 53 forks source link

Refactor acceptance tests #156

Open dhoppe opened 4 years ago

dhoppe commented 4 years ago

I think the order of the acceptance tests is broken. For example, I am not sure if Rsyslog is installed correctly after the function cleanup_helper was executed. Also, the module for Elasticsearch is not installed or loaded at all.

dhoppe commented 4 years ago

This is related to #151.

The following changes do not solve the problem:

diff --git a/spec/acceptance/actions_spec.rb b/spec/acceptance/actions_spec.rb
index 14f1c97..8fb4caa 100644
--- a/spec/acceptance/actions_spec.rb
+++ b/spec/acceptance/actions_spec.rb
@@ -8,7 +8,13 @@ describe 'Rsyslog actions' do
   context 'basic action' do
     it 'applies with action' do
       pp = <<-MANIFEST
+      class { 'rsyslog':
+        feature_packages => ['rsyslog-elasticsearch'],
+      }
       class { 'rsyslog::config':
+        modules => {
+          'omelasticsearch' => {},
+        },
         actions => {
           'omfile_all_logs' => {
             'type'   => 'omfile',
@@ -21,7 +27,7 @@ describe 'Rsyslog actions' do
           'myaction' => {
             'type'   => 'omelasticsearch',
             'config' => {
-              'queue.type'           => 'linkedlist',
+              'queue.type'           => 'LinkedList',
               'queue.spoolDirectory' => '/var/log/rsyslog/queue'
             }
           }
dhollinger commented 4 years ago

What probably needs to be done first would be to remove the omelasticsearch portion of the actions spec. That test was purely designed to ensure the file was being populated correctly. Not to check if the corresponding module is correctly installed.

Probably should create new sub-tests focused on testing the installation and configuration of specific external modules.