voxpupuli / puppet-cassandra

Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.
https://forge.puppetlabs.com/puppet/cassandra
Apache License 2.0
13 stars 65 forks source link

Clean up tests #484

Open jsczek opened 4 months ago

jsczek commented 4 months ago

Pull Request (PR) description

Fix tests and bring the module up-to-date for Puppet 7-8 This pull request seeks to bring all of the unit tests up to date and passing, in preparation for further work on acceptance testing and modulesync.

This Pull Request (PR) fixes the following issues

Tests on #468 currently failing. This PR will bring the tests up to speed with Puppet 7-8.

There was also a small change I needed to make to the actual code, removing the use of the is_hash function in dse.pp. This function appears to have been removed.

jsczek commented 4 months ago

If you examine the failing tests, they're mostly related to the way RHEL-based OSes are supposed to have different defaults than Debian-based OSes. In params.pp and init.pp there is a case statement that is supposed to be detecting this difference and assigning variables. However it doesn't seem to be doing this, and so the tests are failing.

jsczek commented 3 months ago

I've concluded that the failing tests are because of the way params.pp is being processed. If I remove all the RHEL-based operating systems from the supported list, the tests pass. On the other hand, if I remove all the non-RHEL-based OSes from the list, and leave just RHEL-based, the tests pass. What seems to be happening here is that params.pp is not recomputing the parameter values dynamically, instead it's only compiled once and then those values go to all the tested operating systems. I'm not sure how to correct this, except by moving to a hiera-based approach.