Add ScalaTest pipeline, corrector summary, and PDF improvements#6
Open
pmudry wants to merge 2 commits into
Open
Add ScalaTest pipeline, corrector summary, and PDF improvements#6pmudry wants to merge 2 commits into
pmudry wants to merge 2 commits into
Conversation
New scripts: - scripts/run_tests.py: compile & run ScalaTest suites per student in parallel; handles package renaming, embedded test-class splitting, timeouts and compile errors; writes test_results.json - scripts/generate_summary.py: produce a corrector summary as both Markdown table and colour-coded Typst/PDF from test_results.json PDF template improvements (template.typst.jinja2): - Strip leading level-1 heading from question descriptions to fix duplicate title rendering - Student code always starts on a new page (#pagebreak before answer) - Question description text rendered in Source Sans 3 - Test-result badge per question (green/orange/red/error) in the "Student answer" header alongside the point score - Replace -- with en-dash in title; disable fancy-line and logo generate_pdfs_typst.py: - Add --test-results flag to inject test_results.json into PDFs - Overwrite existing PDFs in output folder instead of erroring - Add json/field imports; Answer dataclass gets optional test_results Documentation & repo hygiene: - docs/WORKFLOW.md: end-to-end guide (prerequisites, agent prompts for Steps 0a/0b, run_tests, generate_pdfs, generate_summary, cheat sheet, troubleshooting) - exams/exam_template.yaml: generic structure template (no real exam content, no student data) - .gitignore: exclude pdf/, pregrade/, *.tar, test_results.json, summary.*, labo_test_*.yaml and other artefacts containing student data 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.
Summary
scripts/run_tests.py: compiles reference solutions + ScalaTest suites once, then for each student × question compiles their code (with package renaming and embedded test-class stripping) and runs the matching suite in parallel; results intest_results.jsonscripts/generate_summary.py: produces a corrector summary as a Markdown table and a colour-coded Typst/PDF fromtest_results.jsongenerate_pdfs_typst.py: new--test-resultsflag, overwrite-safe output,Answer.test_resultsoptional fielddocs/WORKFLOW.mdend-to-end guide with agent prompts;exams/exam_template.yamlgeneric structure template;.gitignoreextended to exclude all student-data artefacts (pdf/,pregrade/,*.tar,test_results.json,summary.*,labo_test_*.yaml)Test plan
uv run python scripts/generate_pdfs_typst.py -i EXAM.yaml -o pdf/produces PDFs without errorsuv run python scripts/run_tests.py -i EXAM.yaml -o test_results.json -j 4completes and writes valid JSONuv run python scripts/generate_pdfs_typst.py -i EXAM.yaml -o pdf/ --test-results test_results.jsoninjects test badges into PDFsuv run python scripts/generate_summary.py -i EXAM.yaml -r test_results.json -o summarywritessummary.mdandsummary.pdfgit statusafter running the full pipeline🤖 Generated with Claude Code