-
Book Overview & Buying
-
Table Of Contents
The Platform Engineer's Handbook
By :
Starter kits should undergo automated testing to ensure they produce valid, functional projects. Testing syntax is necessary but insufficient. You need to verify that generated projects actually work: that the build succeeds, tests pass, linting passes, and the application starts.
The test suite in the GitHub repo for this chapter, test_templates.py, validates starter kit templates at two levels. The first, TestTemplateStructure, runs without executing any code: it checks that every template.yaml declares the correct apiVersion and kind, that required metadata fields are present, and that the skeleton directory contains the files a generated project will need Dockerfile, README.md, and for backend templates the CI workflow and TypeScript config. Because the tests are parametrized over every template/version combination discovered in the templates/ directory, adding a new template version automatically adds it to the test matrix with no changes to...