Bug #27512
Plugin tests can fail due to template snapshot tests
Pull request:
Fixed in Releases:
Found in Releases:
Description
If a template can change based on what plugins are enabled, then tests can fail when that plugin is enabled.
An example is preseed default provisioning template. This template adds python to a list of enabled packages if ansible plugin is enabled. In foreman core we have a snapshot of that template and use that in tests to verify the template render properly. However if ansible is enabled, the rendered template differs from the snapshot and causes the test to fail. This happens when foreman ansible tests are run in ci.
Related issues
Associated revisions
History
#1
Updated by Adam Ruzicka about 3 years ago
- Related to Bug #27513: Tests are failing due to changed template added
#2
Updated by The Foreman Bot about 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6951 added
#3
Updated by The Foreman Bot almost 3 years ago
- Fixed in Releases 1.24.0 added
#4
Updated by Adam Ruzicka almost 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 8413b711395388bbf9826606ae0ae58f1f2ec64e.
Fixes #27512 - Provide a way of overriding template snapshots in tests
This commit allows us to provide multiple snapshot variants for each
template. When we test the template renderer, the rendered template has
to match at least one of the snapshot variants to allow the test to
pass. This is useful when the template contains plugin-specific bits.