mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-12 09:19:44 +00:00
16a2b18c2b
* test: add sqlness compatibility runner Signed-off-by: discord9 <discord9@163.com> * fix: update remote dyn filter request Signed-off-by: discord9 <discord9@163.com> * fix: satisfy compat runner clippy Signed-off-by: discord9 <discord9@163.com> * test: add legacy jsonb compatibility case Signed-off-by: discord9 <discord9@163.com> * test: align legacy jsonb compat assertion Signed-off-by: discord9 <discord9@163.com> * fix: align remote dyn filter proto fields Signed-off-by: discord9 <discord9@163.com> * test: simplify compat topology and SQL handling Signed-off-by: discord9 <discord9@163.com> * fix: switch compat runner to target binary Signed-off-by: discord9 <discord9@163.com> * test: drop compat SQLNESS comment handling Signed-off-by: discord9 <discord9@163.com> * test: support sqlness commands in compat Signed-off-by: discord9 <discord9@163.com> * test: fix compat protocol reconnect Signed-off-by: discord9 <discord9@163.com> * test: filter compat cases by version Signed-off-by: discord9 <discord9@163.com> * test: add merge mode compat case Signed-off-by: discord9 <discord9@163.com> * test: harden compat runner setup Signed-off-by: discord9 <discord9@163.com> * test: address compat review follow-ups Signed-off-by: discord9 <discord9@163.com> * test: tighten compat case validation Signed-off-by: discord9 <discord9@163.com> * test: require explicit compat expectations Signed-off-by: discord9 <discord9@163.com> * test: generate missing compat snapshots Signed-off-by: discord9 <discord9@163.com> * test: add compat dry run Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>
2.4 KiB
2.4 KiB
Agent Guidance for Compatibility Framework
This file is intended for AI agents editing compat cases or the compat runner. Follow these rules to avoid common pitfalls.
verify.result is Expected Output (Not Auto-Generated Silently)
verify.resultcontains the expected output ofverify.sql.- If the file is missing, the runner generates it from actual output and fails.
The agent must review the generated file (
git diff), hand-verify correctness, and commit it before rerunning. Do not blindly commit generated output. - If actual output differs from the expected file, the runner updates
verify.resultwith actual output and fails. The agent must inspect the diff and decide whether the change is intentional (accept) or a bug (fix code).
Namespace Isolation
- Each case owns a unique namespace. No shared namespace support exists.
- Duplicate namespaces are a hard error detected before version filtering.
- The removed
isolationfield is no longer recognized;case.tomlusesdeny_unknown_fields, so any staleisolation = "shared"entry causes a parse error.
case.toml is Strict
deny_unknown_fieldsis enabled. Unknown keys cause a hard parse error.- Version constraint entries in
from_range/to_rangeare validated early; invalid constraints (e.g.>=not-a-version) are hard errors, not silent skips. - All required fields must be non-empty:
name,reason,introduced_by,topologies,from_range,to_range,features,owner.
Phase Semantics
setup.sqlruns on the old (from) binary. Only success is required; output is not compared to any file.verify.sqlruns on the new (to) binary. Output is compared againstverify.result.
PostgreSQL Protocol Cases
- When using
-- SQLNESS PROTOCOL POSTGRES, avoid unqualified table names starting withpg_. GreptimeDB issue #8359 causes the parser to rewrite them topg_catalog.<table>. Qualify such names explicitly or rename the table.
Previewing with --dry-run
cargo run -p sqlness-runner -- compat --dry-run [--from-version vX.Y.Z] [--test-filter "..."]
The dry-run performs full discovery and filtering (name, topology, metadata validation, namespace dedup, version-range matching) but starts no services, creates no temp dirs, and mutates no files. Use it to check which cases would be selected before a real run.