Repository navigation
test(realworld): add multi-dialect real-world corpus with ratchet - #866
Conversation
Add 2,788 production-style statements under testdata/realworld for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake and ClickHouse. TestRealWorldCorpus runs each through split, parse, format, reparse, idempotency and dropped-word checks against known_failures.txt, which records the 1,327 statements that fail on main today. A new failure and a listed failure that now passes both fail the test. Also add scripts/dialect-audit (the same checks for any SQL file), internal/dropcheck (the shared dropped-word detector) and the BenchmarkRealWorldParse / BenchmarkRealWorldParseFormat benchmarks. The formatter's testdata walker skips the corpus until the dialect fixes land. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Claude finished @ajitpratap0's task in 30s —— View job Review of PR #866: real-world corpus and ratchet testThis is a tests-and-tooling PR. I read The ratchet is a good design. A new failure fails the test, and so does a listed failure that now passes. Stale entries and a changed failure stage are also caught, and the panic recovery is useful. Nothing blocks the merge. These are the points I'd fix or consider: 1. Orphaned comment ( 2. Dropped-word detector (
3. Known-failures parser (
4. Test mechanics
5.
6. Corpus size and CI cost 7. Benchmarks 8. Process
SummarySolid and well-scoped. The one clear issue is the orphaned comment in the test. The backslash-escape handling in |
… rune Remove a comment that described a check this branch does not contain, report malformed and duplicate known_failures.txt entries instead of skipping them, note that statement indexes shift when a corpus file changes, and truncate report text on rune boundaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 30s —— View job Review of PR #866 (updated for the latest push)I re-read Several points from the earlier review are already fixed:
Still open
Summary: Nothing blocks the merge. Items 4 and 7 are cheap and worth doing before merge. The rest can be follow-ups. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
Summary
Part 1 of 4 splitting #858 into topical PRs. This one adds only tests and tooling; no library code changes.
testdata/realworld/<dialect>/holds 2,788 production-style statements across PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake and ClickHouse.TestRealWorldCorpusruns every statement through split → parse → format → reparse → idempotency → dropped-word check, againsttestdata/realworld/known_failures.txt. A new failure fails the test, and so does a listed failure that now passes. Regenerate the list withgo test ./pkg/gosqlx -run TestRealWorldCorpus -update-known-failures.go run ./scripts/dialect-audit -dialect <d> file.sqlruns the same checks on any SQL file and prints a summary to stderr.internal/dropcheckholds the dropped-word detector used by the harness and the test.BenchmarkRealWorldParseandBenchmarkRealWorldParseFormatmeasure the whole corpus.TestFormatAST_ReadableSemicolonOnlyTerminatesStatementswalks all oftestdata/. It found 6 corpus statements on main whose;placement is wrong, so it skipstestdata/realworlduntil the fix PR removes the skip.Test Plan
task check(fmt, vet, golangci-lint, race tests): exit 0TestRealWorldCorpuspasses with the regenerated listgo run ./scripts/dialect-audit -dialect mysql testdata/realworld/mysql/*.sql→ 405 statements, 205 pass.gitattributesalready forces LF for*.sql, so the byte-exact checks also hold on Windows CIBreaking Changes
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2