Skip to content

Commit 4bef1b0

Browse files
authored
Merge pull request #154 from cipherstash/remove-legacy-tests
Remove legacy EQL tests src/**/*_test.sql
2 parents b14ab3c + 57d7635 commit 4bef1b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1195
-4413
lines changed

CLAUDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This project uses `mise` for task management. Common commands:
2626

2727
### Testing
2828
- Run all tests: `mise run test`
29-
- Run specific test: `mise run test --test <test_name>`
30-
- Run tests against specific PostgreSQL version: `mise run test --postgres 14|15|16|17`
31-
- Tests are located in `*_test.sql` files alongside source code
29+
- Run SQLx tests directly: `mise run test:sqlx`
30+
- Run SQLx tests in watch mode: `mise run test:sqlx:watch`
31+
- Tests are located in `tests/sqlx/` using Rust and SQLx framework
3232

3333
### Build System
3434
- Dependencies are resolved using `-- REQUIRE:` comments in SQL files
@@ -54,7 +54,7 @@ This is the **Encrypt Query Language (EQL)** - a PostgreSQL extension for search
5454
- `src/config/` - Configuration management functions
5555
- `src/blake3/`, `src/hmac_256/`, `src/bloom_filter/`, `src/ore_*` - Index implementations
5656
- `tasks/` - mise task scripts
57-
- `tests/` - Test files (PostgreSQL 14-17 support)
57+
- `tests/sqlx/` - Rust/SQLx test framework (PostgreSQL 14-17 support)
5858
- `release/` - Generated SQL installation files
5959

6060
### Key Concepts
@@ -65,11 +65,12 @@ This is the **Encrypt Query Language (EQL)** - a PostgreSQL extension for search
6565
- **CipherStash Proxy**: Required for encryption/decryption operations
6666

6767
### Testing Infrastructure
68+
- Tests are written in Rust using SQLx, located in `tests/sqlx/`
6869
- Tests run against PostgreSQL 14, 15, 16, 17 using Docker containers
70+
- Use `mise run test --postgres 14|15|16|17` to test against a specific version
6971
- Container configuration in `tests/docker-compose.yml`
70-
- Test helpers in `tests/test_helpers.sql`
72+
- SQL test fixtures and helpers in `tests/test_helpers.sql`
7173
- Database connection: `localhost:7432` (cipherstash/password)
72-
- **Rust/SQLx Tests**: Modern test framework in `tests/sqlx/` (see README there)
7374

7475
## Project Learning & Retrospectives
7576

@@ -163,7 +164,6 @@ HTML output is also generated in `docs/api/html/` for local preview only.
163164

164165
- SQL files are modular - put operator wrappers in `operators.sql`, implementation in `functions.sql`
165166
- All SQL files must have `-- REQUIRE:` dependency declarations
166-
- Test files end with `_test.sql` and live alongside source files
167167
- Build system uses `tsort` to resolve dependency order
168168
- Supabase build excludes operator classes (not supported)
169169
- **Documentation**: All functions/types must have Doxygen comments (see Documentation Standards above)

DEVELOPMENT.md

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ These are the important files in the repo:
5959
└── playground/ <-- Playground enviroment for experimenting with EQL and CipherStash Proxy
6060
```
6161

62-
Tests live alongside the individual SQL files, with a filename ending with `_test.sql`
62+
Tests are in the `tests/sqlx/` directory using Rust and the SQLx framework.
6363

6464
We break SQL into small modules named after what they do.
6565

@@ -144,85 +144,19 @@ There are tests for checking EQL against PostgreSQL versions 14–17, that verif
144144
- Validating schemas for EQL configuration, encrypted data, and encrypted indexes
145145
- Using PostgreSQL operators on encrypted data and indexes (`=`, `<>`, `@>`)
146146

147+
Tests are written in Rust using the SQLx framework and live in `tests/sqlx/`.
148+
147149
The easiest way to run the tests [is in GitHub Actions](./.github/workflows/test-eql.yml):
148150

149151
- Automatically whenever there are changes in the `sql/`, `tests/`, or `tasks/` directories
150152
- By manually running [the workflow](https://github.com/cipherstash/encrypt-query-language/actions/workflows/test-eql.yml)
151153

152-
This is how the `test-eql.yml` workflow functions:
153-
154-
```mermaid
155-
---
156-
title: Testing EQL
157-
---
158-
stateDiagram-v2
159-
direction LR
160-
classDef code font-family:monospace;
161-
162-
163-
state "🧍 Human makes changes to EQL sources" as changes
164-
state sources_fork <<fork>>
165-
state sources_join <<join>>
166-
state "src/*.sql" as source_sql
167-
state "tasks/**/*" as source_tasks
168-
state "tests/**/*" as source_tests
169-
state sources_changed <<choice>>
170-
171-
state "🛠️ Trigger GitHub Actions workflow test-eql.yml" as build_triggered
172-
state "Matrix: Test EQL SQL components" as matrix
173-
state "Test with Postgres 14" as pg14
174-
state "Test with Postgres 15" as pg15
175-
state "Test with Postgres 16" as pg16
176-
state "Test with Postgres 17" as pg17
177-
state "Check build results" as check
178-
state if_state <<choice>>
179-
180-
changes --> sources_fork
181-
sources_fork --> source_sql:::code
182-
sources_fork --> source_tests:::code
183-
sources_fork --> source_tasks:::code
184-
source_sql --> sources_join
185-
source_tests --> sources_join
186-
source_tasks --> sources_join
187-
sources_join --> source_changed_check
188-
source_changed_check --> sources_changed
189-
sources_changed --> build_triggered : Some changes
190-
sources_changed --> [*]: No changes
191-
192-
state "Check source changes" as source_changed_check
193-
194-
[*] --> changes
195-
196-
build_triggered --> matrix
197-
198-
state fork_state <<fork>>
199-
matrix --> fork_state
200-
fork_state --> pg14
201-
fork_state --> pg15
202-
fork_state --> pg16
203-
fork_state --> pg17
204-
205-
state join_state <<join>>
206-
pg14 --> join_state
207-
pg15 --> join_state
208-
pg16 --> join_state
209-
pg17 --> join_state
210-
211-
state "✅ Pass build" as build_pass
212-
state "❌ Fail build" as build_fail
213-
join_state --> check
214-
check --> if_state
215-
if_state --> build_pass: All success
216-
if_state --> build_fail : Any failures
217-
build_pass --> [*]
218-
build_fail --> [*]
219-
```
220-
221154
You can also [run the tests locally](#running-tests-locally) when doing local development.
222155

223156
### Running tests locally
224157

225-
> [!IMPORTANT] > **Before you run the tests locally** you need to [set up a local dev environment](#set-up-a-local-development-environment).
158+
> [!IMPORTANT]
159+
> **Before you run the tests locally** you need to [set up a local dev environment](#set-up-a-local-development-environment).
226160
227161
To run tests locally with PostgreSQL 17:
228162

docs/assertion-counts.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/test-inventory.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)