Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today. Learn more →
Top 15 Go integration-testing Projects
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
Things I can't live without in a new Go project in no particular order:
- https://github.com/golangci/golangci-lint - meta-linter
- https://goreleaser.com - automate release workflows
- https://magefile.org - build tool that can version your tools
- https://github.com/ory/dockertest/v3 - run containers for e2e testing
- https://github.com/ecordell/optgen - generate functional options
- https://golang.org/x/tools/cmd/stringer - generate String()
- https://mvdan.cc/gofumpt - stricter gofmt
- https://github.com/stretchr/testify - test assertion library
- https://github.com/rs/zerolog - logging
- https://github.com/spf13/cobra - CLI framework
FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb
We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers
-
I also use BDD (Gherkin with godog in particular) to verify and document the expected behaviour of a product from an end user's perspective when needed. I usually do this when the product also contains untested code that I have no control over when I'm working on a problem - this gives me peace of mind over something I can't control while doubling as documentation.
-
ONLYOFFICE
ONLYOFFICE Docs — document collaboration in your environment. Powerful document editing and collaboration in your app or environment. Ultimate security, API and 30+ ready connectors, SaaS or on-premises
-
inbucket
Disposable webmail server (similar to Mailinator) with built in SMTP, POP3, RESTful servers; no DB required.
Longtime mailhog user here; this looks like a nice improvement for cold start developer environments! Another option in the same space (emphasis container size) is https://github.com/inbucket/inbucket
-
gnomock
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 💻
Project mention: How to unit test your database interactions with Docker | reddit.com/r/golang | 2023-03-24https://github.com/orlangure/gnomock does this pretty well, but I liked your solution too, it is neat.
-
venom
🐍 Manage and run your integration tests with efficiency - Venom run executors (script, HTTP Request, web, imap, etc... ) and assertions (by ovh)
Project mention: Ask HN: What's your favorite software testing framework and why? | news.ycombinator.com | 2023-05-21You can also load fixtures in database directly, work with Kafka queues both as a producer (e.g. write an event to a Kafka queue, wait a few seconds and see that it was consumed by the service you test, and that some side effects can be observed) or as a consumer (e.g. make sure after an HTTP call, an event was correctly pushed to a queue), or even read a mailbox in IMAP to check that your service correctly send an email.
It's a bit rough on the edges sometimes, but I'd never go back on writing integration tests directly in my programming language. Declarative is the way to go.
-
We’ve started looking into Tracetest. The visualization is quite on point there. https://github.com/kubeshop/tracetest
-
3 years ago I created a internal library where I worked to setup the testing with the db's. One param was the schema directory and the other one was the path of the data insertion file. It worked really well but was a little slow. It was a little bit weird to configure the container to run the tests. As I would have to give access to go container that ran the unit tests access to docker. But back then I was running boot2docker and made things very cumbersome. I think with a local docker things would be way simpler. I ended up using and normal DB from the CI/CD and https://github.com/DATA-DOG/go-txdb If I had to do it again I might do an hybrid in-between the two solutions
-
SonarLint
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
-
Mocking has some advantages, but so does using a real database, at work we use https://github.com/allaboutapps/integresql and I quite like the approach that integresql has, since it makes possible to have a fresh database with your dummy data for every test without impacting the execution speed (compared to dropping an re-creating the database).
-
-
-
-
mockaroo
Mock-A-🦘 (mock-aa-roo) a comprehensive HTTP/HTTPS interface mocking tool for all your development and testing needs!
-
gogenswagger: https://github.com/Mussabaheen/gogenswagger
-
integration
Integration is a Go tool to run integration tests. Currently, this library supports regular HTTP and GRPC. (by lucasvmiguel)
Link to the library: https://github.com/lucasvmiguel/integration
-
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Go integration-testing related posts
- Integration Tests with Postgres
- How to unit test your database interactions with Docker
- Mocking database calls without a library?
- Rails 7. StartKit v1.2 - gem mailcatcher + Mailer::Preview
- Easy Integration Testing with Venom!
- Venom: Manage and run your integration tests with efficiency
- Consolidating system emails for multiple linux servers
-
A note from our sponsor - SonarLint
www.sonarlint.org | 1 Jun 2023
Index
What are some of the best open-source integration-testing projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | dockertest | 3,502 |
2 | godog | 1,980 |
3 | inbucket | 1,235 |
4 | gnomock | 1,182 |
5 | venom | 796 |
6 | tracetest | 555 |
7 | go-txdb | 541 |
8 | integresql | 522 |
9 | endly | 239 |
10 | govcr | 148 |
11 | probe | 25 |
12 | mockaroo | 20 |
13 | gogenswagger | 5 |
14 | integration | 4 |
15 | suspect | 0 |