Skip to content

Commit 18f6a1d

Browse files
committed
fix: restore accidentally removed tests
1 parent dd4cf66 commit 18f6a1d

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

mise.toml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,46 @@ echo
293293
mise --env tcp run postgres:setup
294294
mise --env tls run postgres:setup
295295
296+
echo
297+
echo '###############################################'
298+
echo '# Test: Prometheus'
299+
echo '###############################################'
300+
echo
301+
302+
mise --env tcp run proxy:up proxy --extra-args "--detach --wait"
303+
mise --env tcp run test:wait_for_postgres_to_quack --port 6432 --max-retries 20
304+
mise --env tcp run test:integration:prometheus
305+
mise --env tcp run proxy:down
306+
307+
echo
308+
echo '###############################################'
309+
echo '# Test: non-TLS'
310+
echo '###############################################'
311+
echo
312+
313+
mise --env tcp run proxy:up proxy --extra-args "--detach --wait"
314+
mise --env tcp run test:wait_for_postgres_to_quack --port 6432 --max-retries 20
315+
mise --env tcp run test:integration:psql-tcp
316+
mise --env tcp run proxy:down
317+
318+
echo
319+
echo '###############################################'
320+
echo '# Test: TLS'
321+
echo '###############################################'
322+
echo
323+
324+
mise --env tls run proxy:up proxy-tls --extra-args "--detach --wait"
325+
mise --env tls run test:wait_for_postgres_to_quack --port 6432 --max-retries 20 --tls
326+
mise --env tls run test:integration:psql-tls
327+
mise --env tls run proxy:down
328+
329+
296330
echo
297331
echo '###############################################'
298332
echo '# Test: Integration'
299333
echo '###############################################'
300334
echo
301335
302-
mise --env tls e
303336
mise --env tls run proxy:up proxy-tls --extra-args "--detach --wait"
304337
mise --env tls run test:wait_for_postgres_to_quack --port 6432 --max-retries 20 --tls
305338
cargo nextest run --no-fail-fast --nocapture -E 'package(cipherstash-proxy-integration)'

tests/tasks/test/integration/psql-tcp.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -x
99
source "$(dirname "${BASH_SOURCE[0]}")/url_encode.sh"
1010

1111
encoded_password=$(urlencode "${CS_DATABASE__PASSWORD}")
12-
12+
echo "Encoded password: ${encoded_password}"
1313

1414
# sanity check direct connections
1515
docker exec -i postgres${CONTAINER_SUFFIX} psql postgresql://${CS_DATABASE__USERNAME}:${encoded_password}@${CS_DATABASE__HOST}:${CS_DATABASE__PORT}/cipherstash <<-EOF
@@ -22,13 +22,13 @@ SELECT 1;
2222
EOF
2323

2424
# Connect to the proxy
25-
docker exec -i postgres psql 'postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash' <<-EOF
25+
docker exec -i postgres psql postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash <<-EOF
2626
SELECT 1;
2727
EOF
2828

2929
# Attempt with TLS
3030
set +e
31-
docker exec -i postgres psql 'postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=require' <<-EOF
31+
docker exec -i postgres psql postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=require <<-EOF
3232
SELECT 1;
3333
EOF
3434
if [ $? -eq 0 ]; then

tests/tasks/test/integration/psql-tls.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ SELECT 1;
2121
EOF
2222

2323
# Connect to the proxy forcing TLS
24-
docker exec -i postgres${CONTAINER_SUFFIX} psql 'postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=require' <<-EOF
24+
docker exec -i postgres${CONTAINER_SUFFIX} psql postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=require <<-EOF
2525
SELECT 1;
2626
EOF
2727

2828
# Connect without TLS
2929
set +e
30-
OUTPUT="$(docker exec -i postgres${CONTAINER_SUFFIX} psql 'postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=disable' --command 'SELECT 1' 2>&1)"
30+
OUTPUT="$(docker exec -i postgres${CONTAINER_SUFFIX} psql postgresql://cipherstash:${encoded_password}@proxy:6432/cipherstash?sslmode=disable --command 'SELECT 1' 2>&1)"
3131
retval=$?
3232
if echo ${OUTPUT} | grep -v 'Transport Layer Security (TLS) connection is required'; then
3333
echo "error: did not see string in output: \"Transport Layer Security (TLS) connection is required\""

0 commit comments

Comments
 (0)