From f5afa419f14ec92d5788493eb51e87b0b0542dc9 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 3 Jun 2022 16:51:28 +0200 Subject: [PATCH] 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. --- postgrest.cabal | 5 +++++ test/io/test_io.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/postgrest.cabal b/postgrest.cabal index 0a9ed9152..2c6fb8eaa 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -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 diff --git a/test/io/test_io.py b/test/io/test_io.py index ef31c036f..bf4f4cb91 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -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(), )