Integration testing toolkit that spins up ephemeral Docker containers for dependencies, eliminating the need for mocks.
Gnomock is an integration testing toolkit that spins up ephemeral Docker containers to simulate application dependencies like databases, message queues, and cloud services. It solves the problem of writing and maintaining complex mocks by providing real, temporary instances of dependencies that can be pre-configured with test data. This allows developers to write tests that run against actual software, catching integration issues early.
Go developers and teams building applications with external dependencies (databases, caches, cloud services) who need reliable integration and end-to-end tests. Also useful for polyglot teams who can leverage its HTTP API for testing in other languages.
Developers choose Gnomock for its batteries-included presets that simplify setup of complex services, its clean API that reduces boilerplate, and its ability to test against real dependencies without the overhead of maintaining mock implementations. Its multi-language support via HTTP API is a unique advantage over similar Go-only tools.
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Gnomock automatically manages the lifecycle of Docker containers, creating and cleaning them up after tests, which eliminates manual setup and teardown code as shown in the simple Start/Stop API.
It provides pre-configured presets for popular services like PostgreSQL, Redis, and Kafka, each with built-in health checks and configuration wrappers, reducing boilerplate and setup complexity.
Allows easy seeding of test data, such as loading SQL schemas or uploading files to S3, with minimal code, demonstrated in the Postgres example with WithQueriesFile.
While primarily for Go, it offers an HTTP API that enables usage in other programming languages, expanding its utility beyond the Go ecosystem, as detailed in the server documentation.
Requires a local Docker daemon, and external DOCKER_HOST support is explicitly marked as experimental in the README, limiting reliability in distributed or remote testing environments.
Certain presets, like Splunk and Microsoft SQL Server, do not support arm64 architectures, which can be a barrier for teams using Apple Silicon or ARM-based servers, as noted in the preset table.
The troubleshooting section admits that tests can fail when run in parallel due to system load, requiring careful management or splitting of test suites in CI pipelines to avoid timeouts.