-- Docs: https://hspec.github.io/hspec-discover.htmlmodule Integration.Sharing.SpecHook whereimport Helpers.PostgresContainer qualified as PostgresContainerimport Helpers.Scripts qualified as Scriptsimport Pqi qualifiedimport Preludeimport Test.Hspecimport TestcontainersPostgresql qualifiedtype HookedSpec = SpecWith Scripts.ScopeParamshook :: HookedSpec -> SpecWith Pqi.Adapterhook hookedSpec = do byDistro "postgres:9" byDistro "postgres:18" where byDistro tagName = describe (toList tagName) $ aroundAllWith ( \action adapter -> PostgresContainer.run TestcontainersPostgresql.Config { tagName, auth = TestcontainersPostgresql.CredentialsAuth "postgres" "postgres", forwardLogs = False } (\(host, port) -> action (adapter, host, port)) ) (parallel hookedSpec)