sqlite tests are failing???

This commit is contained in:
parsonsmatt 2021-04-09 09:31:26 -06:00
parent ed61e90cf0
commit 9026dbea3f
2 changed files with 3 additions and 15 deletions

View File

@ -53,7 +53,7 @@ library
, conduit >=1.3 , conduit >=1.3
, containers , containers
, monad-logger , monad-logger
, persistent >=2.12 && <2.13 , persistent >=2.13 && <3
, resourcet >=1.2 , resourcet >=1.2
, tagged >=0.2 , tagged >=0.2
, text >=0.11 && <1.3 , text >=0.11 && <1.3
@ -154,7 +154,7 @@ test-suite sqlite
Paths_esqueleto Paths_esqueleto
hs-source-dirs: hs-source-dirs:
test test
ghc-options: -Wall ghc-options: -Wall -O2 +RTS -m5m -RTS
build-depends: build-depends:
base >=4.8 && <5.0 base >=4.8 && <5.0
, attoparsec , attoparsec

View File

@ -161,10 +161,6 @@ testSqliteTextFunctions = do
nameContains like "i" [p4e, p3e] nameContains like "i" [p4e, p3e]
nameContains like "iv" [p4e] nameContains like "iv" [p4e]
main :: IO () main :: IO ()
main = do main = do
hspec $ do hspec $ do
@ -173,7 +169,7 @@ main = do
describe "Test SQLite locking" $ do describe "Test SQLite locking" $ do
testLocking withConn testLocking withConn
describe "SQLite specific tests" $ do fdescribe "SQLite specific tests" $ do
testAscRandom random_ run testAscRandom random_ run
testRandomMath run testRandomMath run
testSqliteRandom testSqliteRandom
@ -184,10 +180,6 @@ main = do
testSqliteUpdate testSqliteUpdate
testSqliteTextFunctions testSqliteTextFunctions
run, runSilent, runVerbose :: Run run, runSilent, runVerbose :: Run
runSilent act = runNoLoggingT $ run_worker act runSilent act = runNoLoggingT $ run_worker act
runVerbose act = runStderrLoggingT $ run_worker act runVerbose act = runStderrLoggingT $ run_worker act
@ -196,20 +188,16 @@ run =
then runVerbose then runVerbose
else runSilent else runSilent
verbose :: Bool verbose :: Bool
verbose = False verbose = False
run_worker :: RunDbMonad m => SqlPersistT (R.ResourceT m) a -> m a run_worker :: RunDbMonad m => SqlPersistT (R.ResourceT m) a -> m a
run_worker act = withConn $ runSqlConn (migrateIt >> act) run_worker act = withConn $ runSqlConn (migrateIt >> act)
migrateIt :: RunDbMonad m => SqlPersistT (R.ResourceT m) () migrateIt :: RunDbMonad m => SqlPersistT (R.ResourceT m) ()
migrateIt = do migrateIt = do
void $ runMigrationSilent migrateAll void $ runMigrationSilent migrateAll
withConn :: RunDbMonad m => (SqlBackend -> R.ResourceT m a) -> m a withConn :: RunDbMonad m => (SqlBackend -> R.ResourceT m a) -> m a
withConn = withConn =
R.runResourceT . withSqliteConn ":memory:" R.runResourceT . withSqliteConn ":memory:"