-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The default disk_cache.conf.erb caches everything. #2142
Conversation
…over the default behaviour.
apache::mod::disk_cache is a classthat may have no external impact to Forge modules. This module is declared in 175 of 576 indexed public
|
Hi @Pawa2NR, the change looks good and it's not breaking the old behaviour, one thing, can you add some tests here in order to be sure that everything is fine? Also, can you move the end from the if else statement in the if from the templates? Maybe this can help you: https://httpd.apache.org/docs/2.4/mod/mod_cache.html |
Hi @daianamezdrea, Can you please elaborate on the last part ? I did not understand what you intend here. Thank you |
HI @daianamezdrea , Can you help me here with writing tests for this ? I tested the code on my local systems. And it works as expected. By setting "apache::mod::disk_cache::default_cache_enable: false" I could suppress the default caching behaviour in the disk_cache.conf. Here are some snippets from my puppet run attached. |
@Pawa2NR Hi, looking at your code I agree with the above that some test's would be required. The primary form of test is unit, these tests validate individual parts of the code and ensure that the logic behind it is correct, The relevant test file for the change your making can be found through the following link: https://github.com/puppetlabs/puppetlabs-apache/blob/babc21bb524d2bae88066fe8abeeb7e77ace960a/spec/classes/mod/disk_cache_spec.rb
For the other style of tests, referred to as acceptance, these involve making actual changes to a machine in order to ensure that they occur as expected, and the relevant file can be found through here: https://github.com/puppetlabs/puppetlabs-apache/blob/babc21bb524d2bae88066fe8abeeb7e77ace960a/spec/acceptance/apache_parameters_spec.rb |
# Conflicts: # spec/classes/mod/disk_cache_spec.rb
Hi @david22swan, Could you please have a look at the spec test ? I am bit stuck with the passing the parameters to the test. Looks like my pre-condition is not getting passed. Could you please help me here ? The test result is at https://travis-ci.com/github/puppetlabs/puppetlabs-apache/jobs/502848282. And the tests i wrote are at https://github.com/puppetlabs/puppetlabs-apache/blob/b0dc8820991d3c08b1410c0bb37ef4011e4df039/spec/classes/mod/disk_cache_spec.rb I have never used Ruby until now, would be great if you could assist here. |
Taking a look, for the missing error returns, you don't seem to have set Hope this helps |
Hi @david22swan , I corrected the unit tests and also defined default_cache_enable as a Boolean. |
@Pawa2NR Sorry for the wait on a reply. |
Hi @david22swan , Thank you for the review. As requested, I have updated the description for the parameter in disk_cache.pp. |
@Pawa2NR Thanks for the quick response :) |
Need more control over the default behaviour. Causes issue when only a particular path is to be cached and not the whole website.