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
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Please refer to the full example code for more details.

  • 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.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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:

  • 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