Go Package for better integration tests: github.com/ory/dockertest

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • Please refer to the full example code for more details.

  • GitHub repo go-sqlmock

    Sql mock driver for golang to test database interactions

    We have different ways to write our tests depending on what datastore we are using, for example if we are testing database calls that happen to be using database/sql then importing a package like github.com/DATA-DOG/go-sqlmock could work.

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • GitHub repo gomemcache

    Go Memcached client library #golang

    In cases where there's no de-facto package used for mocking calls, we could define our own interface type that happens to be defining the concrete calls we use in your code, for example if we are planning to mock memcached calls and github.com/bradfitz/gomemcache it's being used, then something like the following could work:

  • GitHub repo dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

    There's no excuse not to use github.com/ory/dockertest when working with datastores in Go. ory/dockertest simplifies integration tests and reduces the dependencies needed when running our tests because only Docker is required in those cases.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts