Add pgTAP testing infrastructure #135
Open
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
This PR introduces pgTAP as a robust testing framework for EQL, providing industry-standard PostgreSQL testing capabilities alongside the existing custom assertion helpers.
What's Included
Task 1: Install and Configure pgTAP ✅
Dockerfile.pgtap
that extends official PostgreSQL images (14-17) and installs pgTAP 1.3.5docker-compose.yml
to build custom images with pgTAP for all PostgreSQL versionstests/install_pgtap.sql
to install and verify the pgTAP extensiontasks/test-pgtap.sh
- a mise task to run pgTAP tests with PostgreSQL version selectionTask 2: Structure Testing Suite ✅
Created comprehensive structure tests in
tests/pgtap/structure/
:All structure tests passing ✓
Task 3: Functionality Testing Suite (Partial) ✅
eql_v2_encrypted = eql_v2_encrypted
with HMAC and Blake3 indexeseql_v2.eq()
functioneql_v2_encrypted = jsonb
andjsonb = eql_v2_encrypted
operationsTesting
All tests pass successfully:
pgTAP tests can be run with:
Benefits
Implementation Plan
This PR implements Tasks 1-3 from
docs/pgtap-implementation-plan.md
. Remaining tasks:Related
Based on the implementation plan in
docs/pgtap-implementation-plan.md