feat: Add resolved host to "Listening on ..." messages (#3560)

This adds resolved host's IP to "Listening on ..." messages emitted when
app and admin servers start.
This commit is contained in:
Andrei Dziahel
2024-08-01 11:31:35 -05:00
committed by GitHub
parent 48edab24c6
commit 46537879ae
7 changed files with 45 additions and 8 deletions
+13
View File
@@ -1258,6 +1258,19 @@ def test_log_postgrest_version(defaultenv):
assert "Starting PostgREST %s..." % version in output[0]
def test_log_postgrest_host_and_port(defaultenv):
"PostgREST should output the host and port it is bound to."
host = "127.0.0.1"
port = freeport()
with run(
env=defaultenv, host=host, port=port, no_startup_stdout=False
) as postgrest:
output = postgrest.read_stdout(nlines=10)
assert f"Listening on {host}:{port}" in output[2] # output-sensitive
def test_succeed_w_role_having_superuser_settings(defaultenv):
"Should succeed when having superuser settings on the impersonated role"