-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add Plugin Log parser #912
Conversation
@@ -0,0 +1,70 @@ | |||
<%- | Optional $logfile = undef | -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a spec test that shows how the template would be rendered given the default setting. Check out an example at https://github.com/ghoneycutt/puppet-module-bind/blob/master/spec/defines/acl_spec.rb#L22-L47
@@ -0,0 +1,5 @@ | |||
#https://wiki.opnfv.org/display/fastpath/Logparser+plugin+HLD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The types should have spec tests. Here's an example at https://github.com/sensu/sensu-puppet/blob/master/spec/type_aliases/backend_url_spec.rb
Basically you have two arrays, one of things that should pass and another of things that should fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I use the same approach? Asking since I see it uses shoulda-matchers (If im not mistaken allow_value method is a part of it) Asking since if i'm to use the same approach to testing it I would have to add shoulda-matchers since I dont believe that puppet uses it right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
it "Will create #{options[:plugin_conf_dir]}/06-log_parser.conf" do | ||
is_expected.to contain_file('log_parser.load').with( | ||
ensure: 'present', | ||
path: "#{options[:plugin_conf_dir]}/06-log_parser.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @ghoneycutt mentioned, can you adda a test that verifies the content of the file? You could follow the approach he linked, or extend the acceptance tests to setup this plugin or provide a file as fixture and compare it. We do that here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what you had in mind?
The test looks good. Sadly something changed within the puppet 5 debian package or the image and it stopped working. This effects not only our collectd module but also all other modules we have. Hopefully Puppet can fix this during the next week. |
So do we have to wait for a fix for puppet or could we get this PR merged before that? |
We need to wait until it's fixed.hopefully it's fixed soon |
Added log parser plugin.