graphql-engine/server/lib/api-tests/test-runner/Main.hs
Philip Lykke Carlsen df12c7cf46 fix(api-tests): Ensure the test runner runs the logger cleanup function.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8602
GitOrigin-RevId: 7e07b8b0556a22edf4e058e23ff020cc5e8528f6
2023-04-04 09:01:44 +00:00

27 lines
768 B
Haskell

{-# LANGUAGE ImportQualifiedPost #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}
module Main where
--------------------------------------------------------------------------------
import Control.Monad
import Spec qualified as Test
import SpecHook qualified as Test
import System.Exit
import Test.Hspec.Core.Runner qualified as Hspec
--------------------------------------------------------------------------------
-- | Entrypoint for api-tests test-suite.
main :: IO ()
main = do
testingMode <- Test.setupTestingMode
(logger, cleanupLogger) <- Test.setupLogger
Test.setupGlobalConfig testingMode (logger, cleanupLogger)
res <- Hspec.hspecWithResult Hspec.defaultConfig Test.spec
cleanupLogger
unless (Hspec.summaryFailures res == 0) $ exitFailure