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 acceptance tests #156

Open
dhoppe opened this issue May 27, 2020 · 2 comments
Open

Refactor acceptance tests #156

dhoppe opened this issue May 27, 2020 · 2 comments

Comments

@dhoppe
Copy link
Member

dhoppe commented May 27, 2020

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
Copy link
Member Author

dhoppe commented May 27, 2020

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants