Top 23 Go Testing Projects
-
Gor
GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
Not OP, but that is the idea. I use this tool for it, as it is dead-simple to get running and fairly configurable: https://github.com/buger/goreplay
-
learn-go-with-tests
Learn Go with test-driven development
Yeah I noticed this. Annoyingly it renders fine in github https://github.com/quii/learn-go-with-tests/blob/main/intro-to-generics.md#next-generic-data-types
-
Scout
Get performance insights in less than 4 minutes. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
-
Testify
A toolkit with common assertions and mocks that plays nicely with the standard library
There is a nice package called testify: https://github.com/stretchr/testify
-
GoConvey
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
-
chromedp
A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.
I have recently been playing with chromedp in order to programmatically control a Chromium browser to scrape some information. I have some memories from implementing a similar task in Node.js, and I was pleased to leverage a strongly typed language for the job.
-
gomock
GoMock is a mocking framework for the Go programming language. (by golang)
Project mention: Part-2: Building a basic microservice with unidirectional-streaming gRPC using Golang | dev.to | 2021-02-25To write the unit test we'll need to generate the mock of multiple interface as required. mockgen is the ready-to-go framework for mocking in Golang, so we'll be leveraging it in our unit tests.
-
terratest
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.
Project mention: Best static code analysis tool for Terraform? | reddit.com/r/Terraform | 2021-02-03add https://github.com/gruntwork-io/terratest .. if you are using terraform <=12 maybe kitchen.
-
ginkgo
BDD Testing Framework for Go
As a big fan of automated testing, it’s comforting to learn that we can easily write tests for our controllers using envtest (which runs a local k8s control plane so we can run our tests against it), the Gingko testing framework and the Gomega matching/assertion library:
-
goss
Quick and Easy server testing/validation
The repository is private but there is a CI/CD no-downtime deployment process. So fancy! I use goss to test the built image along with the docker/build-push-action. The end of my ci.yml GitHub Action workflow looks like this:
-
realize
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
-
go-fuzz
Randomized testing for Go
Project mention: SQLFuzz made easy to load huge amount of test data into SQL databases | reddit.com/r/golang | 2021-02-25Maybe you can add support for using a fuzzer like https://github.com/dvyukov/go-fuzz or https://github.com/google/gofuzz
-
go-grpc-middleware
Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
And initialize our gRPC service, here i used gRPC Middleware repository for unary interceptors:
-
go-sqlmock
Sql mock driver for golang to test database interactions
Project mention: tidb-lite: used for unit testing of Golang database-related code | dev.to | 2021-02-14Another common method is to mock SQL services in the test. At present, the more popular solution is to use go-sqlmock.
-
gotests
Automatically generate Go test boilerplate from your source code.
You can save yourself a minute and generate the test case boilerplate for your with https://github.com/cweill/gotests :)
-
Gauge
Light weight cross-platform test automation
-
go-cmp
Package for comparing Go values in tests
One thing to keep in mind about reflect.DeepEqual is because of the way it is implemented you could get positive results when the values are not actually the same, see this comment for reference.
-
selenoid
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
-
hoverfly
Lightweight service virtualization/API simulation tool for developers and testers
-
httpexpect
End-to-end HTTP and REST API testing for Go.
Project mention: Hacktoberfest: 69 Beginner-Friendly Projects You Can Contribute To | dev.to | 2020-09-29https://github.com/gavv/httpexpect End-to-end HTTP and REST API testing for Go.
-
conftest
Write tests against structured configuration data using the Open Policy Agent Rego query language
Project mention: Mental models for understanding Kubernetes Pod Security Policy PSP | reddit.com/r/kubernetes | 2021-01-16Can Gatekeeper and Conftest single-source the same set of rules? I'm looking at https://github.com/open-policy-agent/conftest/issues/54#issuecomment-528988831 and not seeing how.
-
rod
A Devtools driver for web automation and scraping
-
Looking for Maintainer
Selenium/Webdriver client for Go (by tebeka)
-
gomega
Ginkgo's Preferred Matcher Library
Index
What are some of the best open-source Testing projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | Gor | 13,905 |
2 | learn-go-with-tests | 12,964 |
3 | Testify | 12,653 |
4 | GoConvey | 6,205 |
5 | chromedp | 5,954 |
6 | gomock | 5,275 |
7 | terratest | 4,956 |
8 | ginkgo | 4,554 |
9 | goss | 4,278 |
10 | realize | 3,934 |
11 | go-fuzz | 3,879 |
12 | go-grpc-middleware | 3,350 |
13 | go-sqlmock | 3,265 |
14 | gotests | 3,078 |
15 | Gauge | 2,430 |
16 | go-cmp | 2,168 |
17 | selenoid | 1,834 |
18 | hoverfly | 1,702 |
19 | httpexpect | 1,631 |
20 | conftest | 1,615 |
21 | rod | 1,371 |
22 | Looking for Maintainer | 1,344 |
23 | gomega | 1,308 |