[ANN] tmp-proc, simplifying docker integration tests

I’ve written a utility library, tmp-proc to simplify the use of dockerized backends from Haskell integration tests.

At its core, it shells out to a series of docker commands that bracket test runs, but its API is organized to make it simple from integration test code to

  • launch multiple services on docker during test setup
  • connect those services to a WAI server being tested
  • connect to the launched services to query their state during a test
  • teardown the launched services on test completion

This is all done extensibly, and fits in well with setup/teardown hooks in testing libraries like hspec and tasty et al, so it should be both easy to use and customize.

Interested ? Please try out tmp-proc and let me know what you think.

4 Likes

Why not use a real docker client talking to the HTTP API?

1 Like

That’s a good idea - are there specific situations where having this will make the library more useful for you ? At the very least it should make it be possible to use docker installations on other network nodes…

At the moment, the library shells out because that was an easy way to get it started. It’s worked for all my use cases so I’ve not really needed to change this so far. I’d be happy to look into using the API if that will make it more useful.

Well, I haven’t looked deep enough, but my guess is:

  1. error handling will be better, because you get fine-grained status codes and error payloads
  2. Parsing output will be easier and more well-typed

There seems to be https://hackage.haskell.org/package/docker

1 Like

Thanks for sharing, I’ll try this out tomorrow.

1 Like