SparkGen Template Test
Run the cookiecutter matrix test to verify the template generates correctly.
Dynamic Context
Before testing:
- •Verify
test_cookiecutter_matrix.shexists - •Check cookiecutter is installed:
cookiecutter --version - •Check Python is available:
python --version
Actions
Run All Combos (/sparkgen-template-test)
bash
bash test_cookiecutter_matrix.sh
This script:
- •Generates projects with multiple variable combinations
- •Runs
python -m compileallon 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