| name | sparkgen-template-test |
| description | Run cookiecutter matrix tests to verify template generates correctly across all variable combinations |
| user_invokable | true |
| auto_invokable | true |
| auto_invoke_hint | Invoke when discussing template testing, generation issues, or after modifying template files |
| arguments | [--combo N] or no args for all combos |
SparkGen Template Test
Run the cookiecutter matrix test to verify the template generates correctly.
Dynamic Context
Before testing:
- Verify
test_cookiecutter_matrix.sh exists
- Check cookiecutter is installed:
cookiecutter --version
- Check Python is available:
python --version
Actions
Run All Combos (/sparkgen-template-test)
bash test_cookiecutter_matrix.sh
This script:
- Generates projects with multiple variable combinations
- Runs
python -m compileall on each generated project
- Reports pass/fail for each combo
- Cleans up generated directories
Run Specific Combo (/sparkgen-template-test --combo N)
Run only combination N from the matrix. Useful for debugging a specific failure.
Interpreting Results
For each combo, check:
- PASS: Project generated and compiled successfully
- FAIL: Either generation or compilation failed
Common failure causes:
- Jinja2 rendering error: A
{{ }} expression inside {{cookiecutter.project_slug}}/ is not wrapped in {% raw %}...{% endraw %}
- Missing file: Post-generation hook removed a file that's imported elsewhere
- Syntax error: Template conditional (
{% if %}) produced invalid Python/YAML
After Failures
- Look at the specific combo that failed
- Check which cookiecutter variables were used
- Look for Jinja2 escaping issues in the relevant files
- Fix the template file
- Re-run the test to verify