packages feed

dag-migrations-postgresql-simple-0.1.0.0 / test / Main.hs

module Main (main) whereimport Database.DagMigrations.Conformance (adapterConformance)import Database.DagMigrations.PostgreSQL.ExampleSpec qualified as ExampleSpecimport Database.DagMigrations.PostgreSQL.SimpleSpec (postgresFixture, spec)import Database.DagMigrations.PostgreSQL.SqlTextSpec qualified as SqlTextSpecimport Database.DagMigrations.PostgreSQL.TestDatabase (findTestServer)import System.Exit (exitFailure)import System.IO (hPutStrLn, stderr)import Test.Hspec (hspec)main :: IO ()main = do  found <- findTestServer  case found of    Nothing -> do      hPutStrLn stderr "DAG_MIGRATIONS_TEST_DATABASE is not set. In the repository, run the tests through scripts/with-test-postgres, for example: scripts/with-test-postgres cabal test all"      hPutStrLn stderr "Otherwise, set it to a libpq keyword/value connection string that names no database, for a role that can create databases, on a PostgreSQL 13 or later server that has a database named postgres."      exitFailure    Just server -> hspec $ do      adapterConformance (postgresFixture server)      spec server      ExampleSpec.spec server      SqlTextSpec.spec