we had a brief discussion on IRC regarding the community templates that we wanted to bring to discourse. Please allow me to summarize what we discussed mixed with my thoughts.
In core we have snapshot tests for templates. They render all templates with a predefined fixture set and compare them with a saved version of the rendered templates. This allows us to refactor the templates or the renderer and make sure this does not have any unwanted side effects as there would be a difference between the saved version and the new version. So this technique is a huge help when working on the rendering engine in Foreman.
One release todo is importing the templates from community templates to Foreman. This caused the snapshot generation (and the snapshot tests) to fail because the snapshot rendering engine does not handle nested snippets well (#26612). We could workaround this quite fast and will solve the root cause when there is time, but ideally, we want to notice these issues a lot earlier.
We do have tests in community-templates, but they use an entirely different renderer to render the templates. Ideally, these tests would use the same renderer as Foreman. I was thinking of adding a rake task to Foreman that given a directory renders the templates with some predefined fixtures.
There were other ideas, though: Maybe release the templates as a seperate gem and consume that in foreman, or maybe have it as a submodule of the main repo. Or move the templates to the Foreman core repo.
We currently have a plugin that imports templates into Foreman from a repo and one that renders templates directly from a git repo or archive. And apparently, users love the import feature. Also, a separate repo is a lower barrier than the core repo (we don’t require any tickets there and it’s more visible) and we can have templates for different plugins there.