puppet-systemd icon indicating copy to clipboard operation
puppet-systemd copied to clipboard

Speedup tests: execute OS independent code once

Open deric opened this issue 1 year ago • 1 comments

This PR might improve speed of rspec tests, ~2k test cases removed.

OS independent tests will be executed only once instead of running for each supported platform.

deric avatar Aug 27 '24 14:08 deric

On the other hand, it can also be very easy to miss it when we do become more fact dependent.

When you add new feature, you should write tests to cover that feature. By executing the same tests many times with different OS facts, you won't improve quality of tests (when the code doesn't depend on those facts).

Another option is to introduce an alternative to on_supported_os. Something like on_reduced_supported_os that could be smarter and filter out some combinations.

Having a method like on_supported_family where for each OS family it would pick e.g. the latest supported OS would be nice. It

deric avatar Aug 29 '24 10:08 deric