test: EQL v3 fixtures and benchmark schema (gated on eql-mapper v3)#411
Open
freshtonic wants to merge 5 commits into
Open
test: EQL v3 fixtures and benchmark schema (gated on eql-mapper v3)#411freshtonic wants to merge 5 commits into
freshtonic wants to merge 5 commits into
Conversation
Port tests/benchmark/sql/benchmark-schema.sql to EQL v3 as benchmark-schema-v3.sql. The equality-only encrypted benchmark column becomes eql_v3.text_eq (hm term); the eql_v2.add_column call is dropped because EQL v3 has no database-side configuration (the proxy-side Encrypt config replaces it). Applied via the new (opt-in) benchmark:setup:v3 task. The pgbench transaction scripts are version-agnostic and remain shared with v2. GATED: the eql-mapper cannot speak EQL v3 yet, so this schema is not used by the default benchmark tasks.
Port tests/sql/schema.sql to EQL v3 as schema-v3.sql (with matching
schema-v3-uninstall.sql), applied by the new opt-in postgres:setup:v3
task after postgres:eql:v3:setup.
Column domains are derived from each column's v2 add_search_config
calls:
encrypted_text unique+match+ore -> eql_v3.text_search
encrypted_bool unique+ore -> eql_v3.bool (storage-only)
encrypted_int2/4/8 unique+ore -> eql_v3.int{2,4,8}_ord_ore
encrypted_float8 unique+ore -> eql_v3.float8_ord_ore
encrypted_date unique+ore -> eql_v3.date_ord_ore
encrypted_jsonb(_filtered) ste_vec -> eql_v3.json
encrypted_unconfigured (none) -> eql_v3.text (storage-only)
The per-test ORE/OPE fixture tables get the matching *_ord_ore /
*_ord_ope domains (ORE text keeps its match term via eql_v3.text_search;
OPE text uses eql_v3.text_ord_ope).
All add_search_config / add_encrypted_constraint calls are dropped: v3
has no database-side configuration, and the fail-closed domain CHECKs
replace the encrypted constraint.
The fixture reuses the v2 table names so the existing integration suite
can ride on it unchanged once the mapper speaks v3; applying it replaces
the v2 fixture (restore with postgres:setup).
GATED: not applied by postgres:setup while the eql-mapper cannot speak
EQL v3.
Add an eql_v3 module with #[ignore = "blocked on eql-mapper v3"]
variants for the tests whose SQL/payload surface changes shape between
EQL v2 and v3:
- disable_mapping: raw column values are v3 envelopes
({v: 3, i: {t,c}, c, <terms>}, no k discriminator)
- indexing: on-column eql_v2.encrypted_operator_class is replaced by
functional btree indexes on term extractors (eql_v3.ord_term)
- jsonb_containment: eql_v2.jsonb_contains() has no v3 function;
containment is the @> / <@ operators on eql_v3.json
- match_index: LIKE/ILIKE has no v3 equivalent; the match (bloom)
index only supports containment. Deliberately no port of the LIKE
tests - the placeholder documents the replacement surface
- regression_cast: the single ::eql_v2_encrypted cast becomes a
per-domain cast (::text::jsonb::eql_v3.text_search; the leading
::text keeps the bound parameter described as text)
The rest of the integration suite intentionally has no v3 duplicates:
it rides on the fixture and the mapper, and will be enabled wholesale
by the eql-mapper v3 project.
The gated tests never run by default (cargo nextest run is unchanged);
run them with --run-ignored all after mise run postgres:setup:v3.
…SCADE footgun Review feedback: - benchmark-schema-v3.sql now carries the same guarded eql_v2_configuration truncate as schema-v3.sql, so a stale eql_v2.add_column row from a prior v2 benchmark:setup never survives into a v3 setup pointing at a v3-domain column. - Document that benchmark:setup:v3 must be re-run after any postgres:eql:v3:setup/teardown: the CASCADE uninstall silently drops eql_v3-typed columns from tables it doesn't recreate, and benchmark_encrypted is not recreated by postgres:setup:v3.
Review feedback: - regression_cast: reuse common::get_database_port instead of a local panicky re-declaration - disable_mapping, jsonb_containment, match_index: scope queries to the inserted ids so the tests are parallel-safe on the shared encrypted table when they are un-ignored (mirrors the id-range scoping the v2 jsonb containment test uses) - indexing: stop discarding CREATE INDEX errors and assert the EXPLAIN ANALYZE result is non-empty instead of only logging it
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
Ports the EQL v2 test fixtures and benchmark schema to EQL v3, landing everything gated — the eql-mapper cannot speak v3 yet (separate project), so CI behavior is unchanged by construction (625 insertions, 0 deletions).
tests/sql/schema-v3.sql(+uninstall) — v3 twins of all fixture tables reusing the v2 table names, so the 263-test integration suite rides unchanged when the mapper lands. Column→domain mapping derived from each column's v2add_search_config: text→eql_v3.text_search, int/float/date→*_ord_ore, ope tables→*_ord_ope, jsonb→eql_v3.json, bool→storage-onlyeql_v3.bool. Alladd_search_config/add_encrypted_constraintcalls dropped (v3 domains self-validate; config is client-side). Guardedeql_v2_configurationtruncate prevents stale v2 config pointing at v3 columns.tests/benchmark/sql/benchmark-schema-v3.sql+benchmark:setup:v3(email→eql_v3.text_eq); pgbench transaction scripts are version-agnostic and untouched.src/eql_v3/, all#[ignore = "blocked on eql-mapper v3"]. LIKE/ILIKE deliberately not ported (v3 has no pattern matching) — bloom-containment placeholder documents the replacement.postgres:setup:v3.Verification
k-payloads and missing-term payloads rejected withcheck_violationcargo nextest list: zeroeql_v3tests (they appear only under--run-ignored all); full v2 integration suite 348 passed / 0 failed — identical to pre-changeNotes
v3after it merges)benchmark:setup:v3after anypostgres:eql:v3:setup/teardown— the CASCADE teardown drops v3-typed columns from tables not recreated by the fixture (documented in DEVELOPMENT.md)Linear: CIP-3343 (parent CIP-3299).