Testing PostgreSQL for Fun
Jonathan Fischoff
131

Love the approach and the examples, and especially since they are (mostly) readable also to a Haskell newcomer such as myself.

Still, the repository you provided at https://github.com/jfischoff/postgresql-queue doesn’t seem to work over here.

Specifically, it seems to be unable to create a test DB:

```
./.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/db-testing-example-test/db-testing-example-test

Database.PostgreSQL.Simple.Queue
 Database.Queue
 empty locks nothing FAILED [1]
 empty gives count 0
 # PENDING: exception in beforeAll-hook (see previous failure)
 enqueues/tryLocks/unlocks
 # PENDING: exception in beforeAll-hook (see previous failure)
 tryLocks/dequeues
 # PENDING: exception in beforeAll-hook (see previous failure)
 enqueues and dequeues concurrently tryLock
 # PENDING: exception in beforeAll-hook (see previous failure)
 enqueues and dequeues concurrently lock
 # PENDING: exception in beforeAll-hook (see previous failure)
 afterAll-hook FAILED [2]

Failures:

src/Test/Hspec/DB.hs:79: 
 1) Database.PostgreSQL.Simple.Queue.Database.Queue empty locks nothing
 uncaught exception: StartError (InitDBFailed (ExitFailure 127))

2) Database.PostgreSQL.Simple.Queue afterAll-hook
 uncaught exception: Result (Pending (Just “exception in beforeAll-hook (see previous failure)”))

Randomized with seed 1570202556

Finished in 0.0076 seconds
7 examples, 2 failures, 5 pending
```

What’s the usage synopsis? Since I see an ExitFailure 127, I assume it wants some CLI command that I’m not having on my system? (yes, postgresql and psql are there).

I realise that InitDBFailed isn’t in your package, but I still don’t really know my way around stack traces in GHC: how is the temporary DB being created?

Show your support

Clapping shows how much you appreciated Marco Pivetta’s story.