qmetrics.net

Testcontainers for Go

Go package for container-backed integration tests

Testcontainers for Go screenshot

Testcontainers for Go spins up Docker dependencies in tests via a programmatic API and tears them down when tests finish.

Overview

Testcontainers for Go is a Go package aimed at automated integration and smoke tests that need real services in containers. Developers define which containers should run during a test; the library handles creation and cleanup when the test completes.

Documentation is published at golang.testcontainers.org and generated from the project docs tree. A quickstart guide explains adding the dependency to a Go module. Inline documentation and examples are also available on pkg.go.dev.

The wider Testcontainers project supports multiple languages; the Go edition is the Go implementation. Adopters listed in the docs include teams using it for server testing, metrics agents, microservice end-to-end checks, and OpenTelemetry collector integration tests.

The API is straightforward for declaring test-time infrastructure without manual Docker orchestration in each test file.

Key features

  • Programmatic container lifecycle in tests
  • Automatic cleanup after tests
  • Go module dependency
  • Documented quickstart flow
  • pkg.go.dev examples
  • Integration and smoke test focus
  • Part of multi-language Testcontainers family
  • Used by observability and APM projects

Use cases

  • Database integration tests in Go
  • Smoke testing microservices
  • Collector receiver integration tests
  • Ephemeral dependencies in CI
  • Local parity with production services

Tags

Similar software

Selenium

Cross-language browser automation via W3C WebDriver

Selenium automates Chrome, Firefox, Edge, and Safari from Java, Python, C#, Ruby, JavaScript, or Kotlin. It implements the W3C WebDriver standard and downloads browser drivers automatically.

★ 34.6k⟳ todayApache-2.0

Testify

Go test helpers for assertions, mocks, and suites

Testify is a set of Go packages that extend the standard testing library with readable assertions, hard failures, mocks, and structured suites. Install it with go get.

★ 26.3k⟳ 2 months agoMIT

React Testing Library

React DOM component testing utilities

A lightweight library that adds testing helpers on top of react-dom and react-dom/test-utils. It steers tests toward user-like DOM interaction instead of component implementation details.

★ 19.7k⟳ 3 months agoMIT

volkswagen

Node library that passes tests under CI detection

Volkswagen is a small Node module that detects continuous-integration environments and alters test behavior so suites exit successfully when run on CI servers.

★ 15.5k⟳ 9 months agoMIT

Mockito

Java mocking framework for unit tests

Mockito is a mocking framework for unit tests written in Java. It provides a small API to create mocks, stub behavior, verify interactions, and support partial spies and injection.

★ 15.5k⟳ 2 days agoMIT

supertest

Node.js HTTP server testing via superagent

Supertest offers a fluent API for asserting HTTP behavior against Node.js servers during automated tests. It builds on superagent so you can express status, headers, and body expectations in code.

★ 14.4k⟳ 21 days agoMIT