Skip to content

test(matrix): capture int4 matrix executed SQL#248

Draft
tobyhede wants to merge 1 commit into
v3-domain-type-int4from
test/matrix-sql-capture
Draft

test(matrix): capture int4 matrix executed SQL#248
tobyhede wants to merge 1 commit into
v3-domain-type-int4from
test/matrix-sql-capture

Conversation

@tobyhede
Copy link
Copy Markdown
Contributor

@tobyhede tobyhede commented Jun 1, 2026

Adds mise run test:matrix:capture: local-only tool that runs the int4 matrix under log_statement='all' and dumps the SQL Postgres actually executes (raw + filtered) for coverage inspection. No CI wiring.

Add `tasks/test/matrix/capture.sh` (mise task `test:matrix:capture`): a
local-only tool that runs the int4 encrypted-domain test matrix under
`log_statement='all'` and extracts the SQL Postgres actually executes, so the
real operator/cast/index coverage can be inspected against the documented
surface. The matrix builds its SQL at runtime via `format!`, so the executed
statements are the only ground truth.

Flow: rebuild EQL + refresh the install migration (a stale migration silently
reports the wrong surface) -> flip log_statement via ALTER SYSTEM + reload
(trap resets on exit) -> run the matrix serially -> reassemble multi-line
statements from the logs into raw + filtered dumps.

Notable correctness points baked in:
- Capture the EXTENDED protocol (`LOG: execute`) only: that is what sqlx
  issues for every test query; the simple-protocol `statement:` stream is the
  install/migration, not the surface under test.
- Reassemble multi-line statements (the planner-metadata catalog query starts
  with a newline and would otherwise be truncated to nothing).
- --test-threads=1 so concurrent backends don't interleave un-prefixed
  continuation lines into corrupt merged statements.
- Filter admits the temp-table-column probes (typed_col/typed_count blockers,
  min/max aggregates) that carry no eql_v2 token, and drops install/setup noise.

Local verification tool only: no coverage gate, no CI wiring.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bc001ea-25fd-4b88-b9d3-c83c9460c8aa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/matrix-sql-capture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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