chore(tests): output hge stderr in api-tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9384
GitOrigin-RevId: 5d78b59e12bf870a3cba81829dcf4d3e0d2aebf9
This commit is contained in:
Gil Mizrahi 2023-06-01 14:42:12 +03:00 committed by hasura-bot
parent 0d347c1a32
commit b87506e87c

View File

@ -35,6 +35,7 @@ import Data.IORef
import Data.Pool
import Data.Text qualified as T
import Data.Text.Encoding (decodeUtf8)
import Data.Text.IO qualified as T
import Data.Vector (fromList)
import Harness.Exceptions
import Harness.Http qualified as Http
@ -328,8 +329,9 @@ instance LoggableMessage HgeStdErrLogMessage where
hgeStdErrRelayThread :: Logger -> Handle -> IO (IO ())
hgeStdErrRelayThread logger hgeOutput = do
async <- Async.async $ forever $ do
nextChunk <- BS.hGetLine hgeOutput
runLogger logger $ HgeStdErrLogMessage (decodeUtf8 nextChunk)
nextChunk <- decodeUtf8 <$> BS.hGetLine hgeOutput
T.putStrLn nextChunk
runLogger logger $ HgeStdErrLogMessage nextChunk
return $ Async.cancel async
-- | A thread that reads from the engine's StdOut handle and makes one test-log