Repository navigation
test: source-map parity test and gottp bug repros in test/ttpsuite - #109
Merged
Merged
Conversation
TestSourceMapParity parses all 200 TTP suite cases and the gottp repros with source maps off and on and requires the same data. 11 of 210 diverge, tracked in sourcemap_divergences.json by #105-#108. TestGottpRepros replays the spike's nine repros (#28-#36) plus a void repro against Python TTP 0.10.1's results, sharing known_failures.json. record.py expect re-records them and now refuses to run without the optional TTP dependencies, which otherwise silently change expectations. Refs #60 Co-Authored-By: Claude Opus 5.5 <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
Baseline step 3 for #60. Tests and issues only; no gottp code changes.
TestSourceMapParity(newsourcemap_parity_test.go): parses everytest/ttpsuitecase and every repro throughCompiledTemplate.ParseWithValidationwith source maps off and on and requires the same data (or the same error). The source map itself isn't compared.sourcemap_divergences.jsonuses the stale-proof rules ofknown_failures.json: an unlisted divergence, a listed case at parity and a stale entry all fail.TestGottpRepros: the spike's nine repros astestdata/gottp-repros/NAME.{ttp,txt,expected.json}, expectations recorded from Python TTP 0.10.1, sharingknown_failures.jsonwith the suite, so each turns on when its issue is fixed. Plussourcemap_void_group, which matches TTP but coversvoidfor parity (no TTP suite case usesvoid).record.py expectalso re-records the repros, and now exits if an optional TTP dependency fromrequirements.txtis missing. With onlyttp+ PyYAML installed it ran and silently rewrote two suite expectations (test_N2G_formatter,test_group_functions); I reverted those.ttpsuite_test.go: shared harness pulled out (runSuite,runWithTimeout,loadRepros,checkNoStaleEntries,enterPytestDir);TestTTPSuitebehaves as before.test/comparisonisn't included: its cases are inline Go calls toRunComparison, not enumerable data.Divergences (11 of 210)
input=parses onlyDefault_Inputwith source maps on (no fan-out to all inputs;input="a, b"also broken). Template-embedded and<extend>ed inputs give an empty result.failed to parse group <name>:prefix.ignore("<vars name>")empty-record special case exists only inParse(coupled to #31).voidisn't checked on the source-map path.All four come from
ParseWithSourceMapbeing a drifted copy ofParse. The review's other claims: the per_template_anonymous_fold showed no divergence in a probe or in any case;processInputFunctionsreally isn't called on the source-map path, but no case shows a difference (noted in #105).Evidence
sourcemap_divergences.json: a bogus name → "lists … which is not a case"; listing a case at parity → "is now at source-map parity: remove it"; dropping an entry → "not in sourcemap_divergences.json". Restored afterwards.record.py expect --checkwith the fullrequirements.txtvenv:210 cases, 0 expectation(s) changed.go vet ./...,go test ./...andgo test -race(excludingtest/memory,GOTTP_PYTHONset), staticcheck 2025.1.1 andGOOS=js GOARCH=wasm go build ./...all pass locally.Merge Danger
Low. The change is in
test/ttpsuiteonly. Risks:go testuntil its table entry is removed. That's intended, and the failure message says so.record.pyrefuses to run without the optional dependencies. That's intended, but anyone using a minimal venv now has to installtest/ttpsuite/requirements.txt.🤖 Generated with Claude Code