Writing a testing suite for a go REST api with docker?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • heyluuk

  • Check this repo, in particular this docker-compose-test.yml. This script is then used to spin up a docker with postgres for testing and kills it afterwards.

  • dockertest

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

  • A couple options I've used as others have stated are to mock the db calls, or spin up a docker container of the db to run tests against. This package from ory called [dockertest](https://github.com/ory/dockertest) has worked really well for me. It supports a lot of commonly used databases and was pretty easy to get started with.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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