Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ $(EXTENSION).control: $(EXTENSION).control.in
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

# otherwise contrib_regression is picked
CONTRIB_TESTDB = postgres

.PHONY: test
test:
net-with-nginx python -m pytest -s -vv $(PYTEST_ARGS)
net-with-nginx make installcheck
18 changes: 18 additions & 0 deletions test/expected/http_get_wait.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
\set ON_ERROR_STOP on
BEGIN;
SELECT net.http_get('http://localhost:8080') AS request_id \gset
-- COMMIT is required otherwise the test runs forever
COMMIT;
SELECT (result).status,
(result).message,
((result).response).status_code,
((result).response).body
FROM (
SELECT net._http_collect_response(:request_id, async := false) AS result
) AS response;
status | message | status_code | body
---------+---------+-------------+-------------
SUCCESS | ok | 200 | Hello world+
| | |
(1 row)

14 changes: 14 additions & 0 deletions test/sql/http_get_wait.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
\set ON_ERROR_STOP on

BEGIN;
SELECT net.http_get('http://localhost:8080') AS request_id \gset
-- COMMIT is required otherwise the test runs forever
COMMIT;

SELECT (result).status,
(result).message,
((result).response).status_code,
((result).response).body
FROM (
SELECT net._http_collect_response(:request_id, async := false) AS result
) AS response;
Loading