Skip to content

feat(native): attach SQL tests, scenarios and functions natively behind the preview engine - #1022

Merged
kvlonge merged 8 commits into
mainfrom
feat/native-attachments-tests
Oct 8, 2026
Merged

kvlonge merged 8 commits into
mainfrom
feat/native-attachments-tests

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

M3g chunk 2 moves the remaining Python attachment work for SQL tests, scenarios and functions onto the native path behind the native-preview engine. Output stays byte-identical to Python or defers to it.

Changes

All under the preview ATTACHMENTS stage:

  • SQL test @param("name") references are scanned natively (quotes, comments, dollar quotes, Python whitespace). Python still renders the typed values; malformed or undeclared references defer.
  • The omitted trailing SELECT 1 of test and scenario bodies is located natively under each adapter's lexical syntax. Non-ASCII keyword text defers.
  • The raw pass for macro, UDF and table-function tests stays Python on every engine (aligning extractors is M3j).
  • Scenario CTEs are extracted and classified natively. Dialect-sensitive SQL, quoted or non-ASCII CTE names, case-mapped characters and every error defer to Python.
  • Model test targets (mocks, macro mocks, expected models, assertion targets) and scenario source references are validated natively with Python's messages, against one catalog built per compile.
  • SQL and Python function headers (arguments, returns, table columns, tags, description, runtime, entry point, packages) are parsed natively, and function namespaces resolve natively. Template expansion keeps Python's order and labels.
  • fix(test): rewrite references in helper CTEs and order them after their dependencies #1019's helper CTE checks (reachability, P013) stay in Python and run after the native target validation, as before.

Verification

  • cargo test --workspace (201), clippy and fmt (1.98.0)
  • Seeded Python-vs-preview parity tests for each part, plus the whole-project test with parameterized, macro-mode, omitted-SELECT, raw direct-logic regression and fix(test): rewrite references in helper CTEs and order them after their dependencies #1019 helper CTE tests (helper __ref, helper chains, unread helpers, P013)
  • make compiler-differential with CI's coverage flags: 216/216; make compiler-differential-shipped: 210/210
  • tests/e2e/scripts/compiler_differential: 24 passed
  • make check-ci, make test (11795 passed), hygiene scan

@kvlonge
kvlonge force-pushed the feat/native-attachments-tests branch from fa7c007 to 93d6113 Compare October 8, 2026 05:47
@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 06:37
@kvlonge
kvlonge merged commit 4f9a9b7 into main Oct 8, 2026
38 checks passed
@kvlonge
kvlonge deleted the feat/native-attachments-tests branch October 8, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant