Project

General

Profile

Bug #27512

Plugin tests can fail due to template snapshot tests

Added by Adam Ruzicka 6 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
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

Related to Ansible - Bug #27513: Tests are failing due to changed templateReady For Testing

Associated revisions

Revision 8413b711 (diff)
Added by Adam Ruzicka 4 months ago

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.

History

#1 Updated by Adam Ruzicka 6 months ago

  • Related to Bug #27513: Tests are failing due to changed template added

#2 Updated by The Foreman Bot 6 months 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 4 months ago

  • Fixed in Releases 1.24.0 added

#4 Updated by Adam Ruzicka 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF