Skip to content

Commit 6a1b355

Browse files
committed
Tests
1 parent a961d9e commit 6a1b355

File tree

5 files changed

+19
-56
lines changed

5 files changed

+19
-56
lines changed

.github/workflows/test-eql.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ jobs:
3131
postgres-version: [17, 16, 15, 14]
3232

3333
env:
34-
CS_DATABASE__PASSWORD:
35-
CS_DATABASE__PORT: 5432
3634
CS_DATABASE__NAME: test
35+
CS_DATABASE__PASSWORD:
36+
CS_DATABASE__PORT: 5532
37+
3738

3839
steps:
3940
- uses: actions/checkout@v4
4041

41-
- uses: extractions/setup-just@v1
42+
- uses: jdx/mise-action@v2
43+
with:
44+
version: 2024.12.11 # [default: latest] mise version to install
45+
install: true # [default: true] run `mise install`
46+
cache: true # [default: true] cache mise using GitHub's cache
4247

4348
- uses: ankane/setup-postgres@v1
4449
with:
@@ -47,5 +52,5 @@ jobs:
4752

4853
- name: Test EQL
4954
run: |
50-
just build test
55+
mise run test
5156

mise.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ includes = ["tasks"]
1212

1313
[env]
1414
# Default configuration for running cipherstash-proxy out of the box
15-
CS_DATABASE__NAME = "cipherstash"
16-
CS_DATABASE__USERNAME = "cipherstash"
17-
CS_DATABASE__PASSWORD = "password"
18-
CS_DATABASE__HOST = "localhost"
19-
CS_DATABASE__PORT = "5532"
15+
# CS_DATABASE__NAME = "cipherstash"
16+
# CS_DATABASE__USERNAME = "cipherstash"
17+
# CS_DATABASE__PASSWORD = "password"
18+
# CS_DATABASE__HOST = "localhost"
19+
# CS_DATABASE__PORT = "5532"

sql/015-operators-unique.sql

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,26 +91,6 @@ CREATE OPERATOR <> (
9191
MERGES
9292
);
9393

94-
95-
-- DROP OPERATOR IF EXISTS <> (cs_encrypted_v1, jsonb);
96-
-- DROP FUNCTION IF EXISTS cs_encrypted_neq_v1(a cs_encrypted_v1, b jsonb);
97-
98-
-- CREATE FUNCTION cs_encrypted_neq_v1(a cs_encrypted_v1, b jsonb)
99-
-- RETURNS boolean AS $$
100-
-- SELECT cs_unique_v1(a) <> cs_unique_v1(b);
101-
-- $$ LANGUAGE SQL;
102-
103-
-- CREATE OPERATOR <> (
104-
-- PROCEDURE="cs_encrypted_neq_v1",
105-
-- LEFTARG=cs_encrypted_v1,
106-
-- RIGHTARG=jsonb,
107-
-- NEGATOR = =,
108-
-- RESTRICT = eqsel,
109-
-- JOIN = eqjoinsel,
110-
-- HASHES,
111-
-- MERGES
112-
-- );
113-
11494
DROP OPERATOR IF EXISTS <> (cs_encrypted_v1, cs_unique_index_v1);
11595
DROP FUNCTION IF EXISTS cs_encrypted_neq_v1(a cs_encrypted_v1, b cs_unique_index_v1);
11696

tasks/test.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
connection_url=postgresql://${CS_DATABASE__USERNAME:-$USER}:@localhost:$CS_DATABASE__PORT/$CS_DATABASE__NAME
99

1010
# tests
11+
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/core.sql
12+
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/core-functions.sql
13+
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/config.sql
14+
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/encryptindex.sql
1115
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/operators.sql
1216

13-
# PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/core.sql
14-
# PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/core-functions.sql
15-
# PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/config.sql
16-
# PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f tests/encryptindex.sql
17-
1817
# Uninstall
19-
# PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f release/cipherstash-encrypt-uninstall.sql
18+
PGPASSWORD=$CS_DATABASE__PASSWORD psql $connection_url -f release/cipherstash-encrypt-uninstall.sql
2019

tests/operators.sql

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CREATE TABLE users
1212

1313
TRUNCATE TABLE users;
1414

15-
1615
INSERT INTO users (name_encrypted) VALUES (
1716
'{
1817
"v": 1,
@@ -29,26 +28,6 @@ INSERT INTO users (name_encrypted) VALUES (
2928
);
3029

3130

32-
-- SELECT id FROM users WHERE ARRAY[1,2]::cs_match_index_v1 <@ name_encrypted;
33-
-- SELECT ARRAY[1,2,3,4]::cs_match_index_v1 <@ ARRAY[1,2,3]::cs_match_index_v1;
34-
35-
36-
-- SELECT id FROM users WHERE name_encrypted @> '{"m":[1,2]}'::jsonb;
37-
-- SELECT id FROM users WHERE name_encrypted @> ARRAY[1,2]::smallint[];
38-
-- SELECT id FROM users WHERE name_encrypted @> ARRAY[1,2]::cs_match_index_v1;
39-
40-
-- SELECT id FROM users WHERE name_encrypted @> '{
41-
-- "v": 1,
42-
-- "k": "ct",
43-
-- "c": "ciphertext",
44-
-- "i": {
45-
-- "t": "users",
46-
-- "c": "name"
47-
-- },
48-
-- "m": [1, 2]
49-
-- }'::cs_encrypted_v1;
50-
51-
5231

5332
-- MATCH @> OPERATORS
5433
DO $$

0 commit comments

Comments
 (0)