Skip to content

Commit 49df9aa

Browse files
authored
Merge pull request #1105 from cipherstash/fix/eql-encryption-postgres-task
fix(eql): test the built bundle in test:encryption:postgres, and refuse an empty --ignored selection
2 parents 340b4d5 + dc445db commit 49df9aa

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎packages/eql/mise.toml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,25 @@ cargo clippy --locked -p eql-bindings -p eql-encryption-tests --all-features --a
296296
"""
297297

298298
[tasks."test:encryption:postgres"]
299-
description = "Install the EQL bundle into the database EQL_TEST_DATABASE_URL names and run the stack-encrypt PostgreSQL test against it (fresh encryption, fake KMS)"
299+
description = "Install the EQL bundle built from the tree into the database EQL_TEST_DATABASE_URL names and run the stack-encrypt PostgreSQL test against it (fresh encryption, fake KMS)"
300+
# `build` writes release/cipherstash-encrypt.sql from the SQL in the tree. The
301+
# copy under crates/eql-bindings/sql is the RELEASED bundle, rewritten only by
302+
# the lockstep version bump, so a test that installs it cannot see a SQL edit
303+
# made in the same pull request.
304+
depends = ["build"]
300305
dir = "{{config_root}}"
301306
run = """
302307
#!/usr/bin/env bash
303308
# One connection string serves psql and the test, so the two cannot point at
304309
# different databases. psql accepts a libpq conninfo string as its dbname.
305310
set -euo pipefail
306311
: "${EQL_TEST_DATABASE_URL:?set EQL_TEST_DATABASE_URL to a libpq connection string for a disposable PostgreSQL}"
307-
psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f crates/eql-bindings/sql/cipherstash-encrypt.sql
312+
psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f release/cipherstash-encrypt.sql
313+
# `--ignored` selects by attribute, and cargo exits 0 on an empty selection, so
314+
# a test that loses its `#[ignore]` or is renamed would leave this task passing
315+
# on nothing. List what the filter selects before running it.
316+
listing=$(cargo test --locked -p eql-encryption-tests --test text_eq -- --ignored --list | sed -n 's/: test$//p')
317+
[ -n "$listing" ] || { echo "error: '--ignored' selects no test in text_eq; the PostgreSQL test has gone missing." >&2; exit 1; }
308318
cargo test --locked -p eql-encryption-tests --test text_eq -- --ignored
309319
"""
310320

0 commit comments

Comments
 (0)