Skip to content

Commit 53caf27

Browse files
committed
fix: match develop branch on these changes
fix: docker image test fix: resolve merge conflicts
1 parent 7455dfc commit 53caf27

7 files changed

Lines changed: 37 additions & 511 deletions

File tree

nix/checks.nix

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@
2727
# deadnix: skip
2828
makeCheckHarness =
2929
pgpkg:
30-
<<<<<<< HEAD
31-
{
32-
isCliVariant ? false,
33-
=======
3430
# legacyPkgName: the name used in legacyPackages (e.g., "psql_17" or "psql_17_slim")
3531
{
32+
isCliVariant ? false,
3633
legacyPkgName ? null,
37-
>>>>>>> 40203ba5 (fix: deal with systemd in slim vs regular)
3834
}:
3935
let
4036
pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;
@@ -559,15 +555,6 @@
559555
in
560556
{
561557
psql_15 = pkgs.runCommand "run-check-harness-psql-15" { } (
562-
<<<<<<< HEAD
563-
lib.getExe (makeCheckHarness self'.packages."psql_15/bin" { })
564-
);
565-
psql_17 = pkgs.runCommand "run-check-harness-psql-17" { } (
566-
lib.getExe (makeCheckHarness self'.packages."psql_17/bin" { })
567-
);
568-
psql_orioledb-17 = pkgs.runCommand "run-check-harness-psql-orioledb-17" { } (
569-
lib.getExe (makeCheckHarness self'.packages."psql_orioledb-17/bin" { })
570-
=======
571558
lib.getExe (makeCheckHarness self'.packages."psql_15/bin" { legacyPkgName = "psql_15"; })
572559
);
573560
psql_17 = pkgs.runCommand "run-check-harness-psql-17" { } (
@@ -590,7 +577,6 @@
590577
legacyPkgName = "psql_orioledb-17_slim";
591578
}
592579
)
593-
>>>>>>> 40203ba5 (fix: deal with systemd in slim vs regular)
594580
);
595581
# CLI variant checks
596582
psql_17_cli = pkgs.runCommand "run-check-harness-psql-17-cli" { } (

nix/ext/tests/http.nix

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ pkgs.testers.runNixOSTest {
284284
CREATE TABLE IF NOT EXISTS test_config (key TEXT PRIMARY KEY, value TEXT);
285285
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_port'"'"', '"'"'{http_port}'"'"')
286286
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
287-
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_host'"'"', '"'"'localhost'"'"')
288-
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
289287
'
290288
""")
291289
@@ -319,8 +317,6 @@ pkgs.testers.runNixOSTest {
319317
sudo -u postgres psql -d postgres -c '
320318
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_port'"'"', '"'"'{http_port}'"'"')
321319
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
322-
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_host'"'"', '"'"'localhost'"'"')
323-
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
324320
'
325321
""")
326322
@@ -349,8 +345,6 @@ pkgs.testers.runNixOSTest {
349345
sudo -u postgres psql -d postgres -c '
350346
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_port'"'"', '"'"'{http_port}'"'"')
351347
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
352-
INSERT INTO test_config (key, value) VALUES ('"'"'http_mock_host'"'"', '"'"'localhost'"'"')
353-
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value;
354348
'
355349
""")
356350
installed_extensions=test.run_sql("""SELECT extname FROM pg_extension WHERE extname = 'orioledb';""")

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

nix/packages/postgres.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@
185185
let
186186
base = getPostgresqlPackage version latestOnly;
187187
in
188-
if variant == "cli" then
189-
base.override { portable = true; }
190-
else
191-
base;
188+
if variant == "cli" then base.override { portable = true; } else base;
192189
postgres-pkgs = makeOurPostgresPkgs version { inherit variant latestOnly; };
193190
ourExts = map (ext: {
194191
name = ext.name;

nix/tests/expected/http.out

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Test for http extension
22
-- Basic HTTP functionality tests
33
-- Test basic HTTP GET request
4-
SELECT status FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
4+
SELECT status FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
55
status
66
--------
77
200
@@ -11,7 +11,7 @@ SELECT status FROM http_get('http://' || (SELECT value FROM test_config WHERE ke
1111
SELECT status, content_type
1212
FROM http((
1313
'GET',
14-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers',
14+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers',
1515
ARRAY[http_header('User-Agent', 'pg_http_test')],
1616
NULL,
1717
NULL
@@ -23,7 +23,7 @@ FROM http((
2323

2424
-- Test HTTP POST request with JSON body
2525
SELECT status FROM http_post(
26-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post',
26+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post',
2727
'{"test": "data"}',
2828
'application/json'
2929
);
@@ -34,7 +34,7 @@ SELECT status FROM http_post(
3434

3535
-- Test HTTP PUT request
3636
SELECT status FROM http_put(
37-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put',
37+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put',
3838
'{"update": "data"}',
3939
'application/json'
4040
);
@@ -44,15 +44,15 @@ SELECT status FROM http_put(
4444
(1 row)
4545

4646
-- Test HTTP DELETE request
47-
SELECT status FROM http_delete('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete');
47+
SELECT status FROM http_delete('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete');
4848
status
4949
--------
5050
200
5151
(1 row)
5252

5353
-- Test HTTP PATCH request
5454
SELECT status FROM http_patch(
55-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch',
55+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch',
5656
'{"patch": "data"}',
5757
'application/json'
5858
);
@@ -62,15 +62,15 @@ SELECT status FROM http_patch(
6262
(1 row)
6363

6464
-- Test HTTP HEAD request
65-
SELECT status FROM http_head('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
65+
SELECT status FROM http_head('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
6666
status
6767
--------
6868
200
6969
(1 row)
7070

7171
-- Test response headers parsing
7272
WITH response AS (
73-
SELECT * FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain')
73+
SELECT * FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain')
7474
)
7575
SELECT
7676
status,
@@ -86,7 +86,7 @@ FROM response;
8686
-- This should complete successfully with reasonable timeout
8787
SELECT status FROM http((
8888
'GET',
89-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1',
89+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1',
9090
ARRAY[]::http_header[],
9191
'application/json',
9292
2000 -- 2 second timeout
@@ -97,7 +97,7 @@ SELECT status FROM http((
9797
(1 row)
9898

9999
-- Test URL encoding
100-
SELECT status FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123');
100+
SELECT status FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123');
101101
status
102102
--------
103103
200

nix/tests/sql/http.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22
-- Basic HTTP functionality tests
33

44
-- Test basic HTTP GET request
5-
SELECT status FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
5+
SELECT status FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
66

77
-- Test HTTP GET with headers
88
SELECT status, content_type
99
FROM http((
1010
'GET',
11-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers',
11+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers',
1212
ARRAY[http_header('User-Agent', 'pg_http_test')],
1313
NULL,
1414
NULL
1515
)::http_request);
1616

1717
-- Test HTTP POST request with JSON body
1818
SELECT status FROM http_post(
19-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post',
19+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post',
2020
'{"test": "data"}',
2121
'application/json'
2222
);
2323

2424
-- Test HTTP PUT request
2525
SELECT status FROM http_put(
26-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put',
26+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put',
2727
'{"update": "data"}',
2828
'application/json'
2929
);
3030

3131
-- Test HTTP DELETE request
32-
SELECT status FROM http_delete('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete');
32+
SELECT status FROM http_delete('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete');
3333

3434
-- Test HTTP PATCH request
3535
SELECT status FROM http_patch(
36-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch',
36+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch',
3737
'{"patch": "data"}',
3838
'application/json'
3939
);
4040

4141
-- Test HTTP HEAD request
42-
SELECT status FROM http_head('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
42+
SELECT status FROM http_head('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get');
4343

4444
-- Test response headers parsing
4545
WITH response AS (
46-
SELECT * FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain')
46+
SELECT * FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain')
4747
)
4848
SELECT
4949
status,
@@ -55,11 +55,11 @@ FROM response;
5555
-- This should complete successfully with reasonable timeout
5656
SELECT status FROM http((
5757
'GET',
58-
'http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1',
58+
'http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1',
5959
ARRAY[]::http_header[],
6060
'application/json',
6161
2000 -- 2 second timeout
6262
)::http_request);
6363

6464
-- Test URL encoding
65-
SELECT status FROM http_get('http://' || (SELECT value FROM test_config WHERE key = 'http_mock_host') || ':' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123');
65+
SELECT status FROM http_get('http://localhost:' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123');

0 commit comments

Comments
 (0)