test: template rendering test suite for all recipes#68
Draft
troglodyne-bot wants to merge 1 commit into
Draft
Conversation
42 tests across every recipe module in the repo: verifies that render() completes without error given valid minimal config, and that validate() dies on missing required fields. Recipes requiring filesystem fixtures (backup, backupdestination) spin up a temp SSH keypair via ssh-keygen. Module dependencies (matrix, roundcube) are satisfied by passing modules => ['nginxproxy'] in the test config. Also adds TEST_REQUIRES to Makefile.PL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First test suite for this repo —
t/templates.twith 42 tests covering every recipe module.Why
Zero test coverage meant template bugs only surfaced in production. Template::Toolkit rendering is pure Perl so these run in CI with no provisioning infrastructure.
How
renders_ok()helper: instantiates each recipe, callsrender()with minimal valid config, asserts no exception and non-empty outputrejects_missing()helper: verifiesvalidate()dies when a required field is absentssh-keygenmodules => ['nginxproxy']in test configbin/new_config(domain, install_dir, script_dir, packager_invocation, etc.) are provided as a shared%GhashAlso adds
TEST_REQUIREStoMakefile.PL.Testing
PERL5LIB=/tmp/cpanlib/lib/perl5 make test— 42/42 pass.Deps not in default Ubuntu install:
cpanm Text::Xslate Text::Xslate::Bridge::TT2 Hash::Merge YAML File::Slurper Clone Net::IP UUID CryptX