cabal, tests: require wai-logger 2.4.0, adapt tests

wai-logger version 2.4.0 fixes log output to not say 'unknownSocket'
for unix sockets.
This commit is contained in:
Robert Vollmert
2022-06-13 13:25:54 +02:00
parent 7531c5490d
commit f5afa419f1
2 changed files with 8 additions and 3 deletions
+5
View File
@@ -113,6 +113,11 @@ library
, wai >= 3.2.1 && < 3.3
, wai-cors >= 0.2.5 && < 0.3
, wai-extra >= 3.1.8 && < 3.2
-- We already depend on wai-logger >= 2.3.7 indirectly via wai-extra,
-- but we want to depend on 2.4.0 which fixes 'unknownSocket' log output
-- for unix sockets; this is tested in test/io/test_io.py. See
-- https://github.com/kazu-yamamoto/logger/commit/3a71ca70afdbb93d4ecf0083eeba1fbbbcab3fc3
, wai-logger >= 2.4.0
, warp >= 3.3.19 && < 3.4
-- -fno-spec-constr may help keep compile time memory use in check,
-- see https://gitlab.haskell.org/ghc/ghc/issues/16017#note_219304
+3 -3
View File
@@ -922,7 +922,7 @@ def test_log_level(level, has_output, defaultenv):
assert response.status_code == 200
if has_output[0]:
assert re.match(
r'unknownSocket - postgrest_test_anonymous \[.+\] "GET / HTTP/1.1" 200 - "" "python-requests/.+"',
r'- - postgrest_test_anonymous \[.+\] "GET / HTTP/1.1" 200 - "" "python-requests/.+"',
postgrest.process.stdout.readline().decode(),
)
@@ -930,7 +930,7 @@ def test_log_level(level, has_output, defaultenv):
assert response.status_code == 404
if has_output[1]:
assert re.match(
r'unknownSocket - postgrest_test_anonymous \[.+\] "GET /unknown HTTP/1.1" 404 - "" "python-requests/.+"',
r'- - postgrest_test_anonymous \[.+\] "GET /unknown HTTP/1.1" 404 - "" "python-requests/.+"',
postgrest.process.stdout.readline().decode(),
)
@@ -938,7 +938,7 @@ def test_log_level(level, has_output, defaultenv):
assert response.status_code == 500
if has_output[2]:
assert re.match(
r'unknownSocket - - \[.+\] "GET / HTTP/1.1" 500 - "" "python-requests/.+"',
r'- - - \[.+\] "GET / HTTP/1.1" 500 - "" "python-requests/.+"',
postgrest.process.stdout.readline().decode(),
)