-
Notifications
You must be signed in to change notification settings - Fork 0
Remove legacy EQL tests src/**/*_test.sql #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds Rust test equivalent for src/operators/->_test.sql lines 106-118. Verifies that e -> 'selector' returns JSONB with 'i' (index) and 'v' (version) fields. Part of legacy SQL test migration to Rust/SQLx framework.
- Enhance test comments to clearly explain what behavior is verified - Add NOTE explaining why raw SQLx is used instead of QueryAssertion - Replace unwrap() with expect() for clearer error context
Port missing min/max aggregate tests from SQL to Rust/SQLx framework. Adds 4 new tests covering NULL handling and correct value identification for both min() and max() functions on encrypted integer columns. - New fixture: aggregate_minmax_data.sql with encrypted test data - Tests verify NULL returns for NULL-only queries - Tests verify correct minimum (plain_int=1) and maximum (plain_int=5) values
Add three Rust/SQLx test cases for eql_v2 encrypted column constraint functions: - add_encrypted_constraint_prevents_invalid_data: validates constraint blocks invalid JSONB - remove_encrypted_constraint_allows_invalid_data: validates constraint removal allows invalid data - version_metadata_validation_on_insert: validates v=2 version field enforcement These tests verify the constraint management functions work correctly to prevent insertion of malformed eql_v2_encrypted values.
Add 13 Rust/SQLx test cases for selector-based ORE comparisons with index fallback: - Tests for <, >, <=, >= operators with e->'selector' syntax - Coverage for ore_cllw_u64_8 index type ($.n numeric selector) - Coverage for ore_cllw_var_8 index type ($.hello string selector) - Fallback behavior when requested index type missing Includes new helper function get_ste_vec_selector_term() to extract selector terms using SQL helper functions, matching the pattern from legacy SQL tests. These tests verify that ORE comparisons work correctly with selector extraction and gracefully fall back to JSONB literal comparison when the expected index type is not present.
Add test coverage for JSONB path operators with encrypted selectors: - eql_v2.ciphertext() extraction from arrow operator results - -> and ->> operators with eql_v2_encrypted selectors Tests verify ciphertext extraction functionality and encrypted selector handling across both single-row and multi-row scenarios.
Add test coverage for ORDER BY edge cases and helper function: - NULLS FIRST/LAST behavior in ASC and DESC ordering - eql_v2.order_by() helper function with filtered result sets Tests verify correct NULL positioning in ordered results and proper functioning of the order_by helper across different sort directions.
Add DROP TABLE IF EXISTS before CREATE TABLE to allow fixture to be executed multiple times without 'relation already exists' error.
Add secondary sort by id to ensure deterministic ordering among NULL rows. SQL standard only guarantees NULLs precede/follow non-NULLs, not ordering among equal sort keys. Without tie-breaker, tests could flake depending on planner behavior.
Remove 38 inline SQL test files from src/ directory. These tests have been migrated to the SQLx Rust test framework in tests/sqlx/.
Remove tasks/test/legacy.sh - no longer needed after removal of inline SQL tests.
Remove legacy SQL test invocation from main test runner. Tests now run in 2 phases: 1. SQLx Rust lint checks 2. SQLx Rust tests
Remove files that tracked SQL-to-SQLx test migration: - test-migration-guide.md - test-inventory.md - assertion-counts.md Migration is complete - these files are no longer needed.
- Update file structure description to reference tests/sqlx/ - Simplify testing section to focus on SQLx framework - Remove outdated mermaid workflow diagram - Fix formatting of IMPORTANT block
Update testing documentation to reflect removal of legacy SQL tests and use of SQLx Rust framework only.
The aggregate tests (count, max, min) were incorrectly testing the plain `id` column instead of the encrypted `e` column: - count_aggregate_on_encrypted_column: COUNT(*) → COUNT(e) - max_aggregate_on_encrypted_column: MAX(id) → eql_v2.max(e) - min_aggregate_on_encrypted_column: MIN(id) → eql_v2.min(e) These tests now properly verify that aggregate functions work on encrypted data, not just plain integers.
auxesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup @tobyhede.
I have added suggestions for tidying up after the LLM. I will batch commit those, then this PR should be good to merge.
auxesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup @tobyhede.
I have added suggestions for tidying up after the LLM. I will batch commit those, then this PR should be good to merge.
Claude chattily records the minutiae of transforming text from one file to another. That's not helpful to future maintainers, and will confuse newcomers to the code base.
7afbabc to
57d7635
Compare
Remove legacy EQL tests
Adds additional tests to cover gaps in the initial migration