Skip to content

Commit 5b20cac

Browse files
committed
fix: docker image test
1 parent 40e3e6e commit 5b20cac

2 files changed

Lines changed: 15 additions & 466 deletions

File tree

nix/packages/docker-image-test.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,21 @@ writeShellApplication {
352352
rm -f "$PATCHED_TESTS_DIR/expected/roles.out.bak"
353353
fi
354354
355+
# Patch http.sql and http.out to use http_mock_host instead of localhost
356+
# This is needed because localhost inside container doesn't reach host's mock server
357+
if [[ -f "$PATCHED_TESTS_DIR/sql/http.sql" ]]; then
358+
sed -i.bak \
359+
-e "s@'http://localhost:'@'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':'@g" \
360+
"$PATCHED_TESTS_DIR/sql/http.sql"
361+
rm -f "$PATCHED_TESTS_DIR/sql/http.sql.bak"
362+
fi
363+
if [[ -f "$PATCHED_TESTS_DIR/expected/http.out" ]]; then
364+
sed -i.bak \
365+
-e "s@'http://localhost:'@'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':'@g" \
366+
"$PATCHED_TESTS_DIR/expected/http.out"
367+
rm -f "$PATCHED_TESTS_DIR/expected/http.out.bak"
368+
fi
369+
355370
log_info "Running pg_regress..."
356371
local regress_exit=0
357372

0 commit comments

Comments
 (0)