Top 23 Go Testing Projects
Learn Go with test-driven developmentProject mention: My journey to writing my blog in Go | dev.to | 2021-04-14
Go through Learn Go With Tests to learn how to test the code correctly in Go.
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.Project mention: How To Find Performance Issues Before Deploying | reddit.com/r/sre | 2020-12-29
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
Scout APM - Leading-edge performance monitoring starting at $39/month. 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.
A toolkit with common assertions and mocks that plays nicely with the standard libraryProject mention: Practical unit-testing web client in Go | dev.to | 2021-05-28
At a high level, mocking the client means creating a new struct that implements the interface you are testing (mocking the interface). Then, provide your mocking client to the code under test. A good library with examples is testify.
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.Project mention: Do you prefer go-convey over golang's t.Run? | reddit.com/r/golang | 2021-04-23
For a generic usecase, do you see Go-convey adding any benefit over simple golang t.Run?
A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.Project mention: Docker run ภายใต้ network ของ container อื่น | dev.to | 2021-05-06
GoMock is a mocking framework for the Go programming language. (by golang)Project mention: My experience trying TDD for the first time in Go | dev.to | 2021-05-27
The first day, I wrote my tests for some GET routes. We use something called go-mock in our unit tests, which allows you to only focus on testing the function you're writing. Because of this, I found that you still needed to have a good idea of the code you want to write while writing out the tests. In our case, we needed to mock out our calls to an external API. If you asked for my opinion after the first day, I would've told you that I could envision the benefits of TDD for something like end to end testing, where it's a black box and you're only verifying that the output is what's expected from a given input. But for unit testing, it wasn't any different than just writing the code first.
:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing (by Shopify)Project mention: Managing Cluster Membership with Etcd | dev.to | 2021-03-31
Note that we are creating a custom docker network and a Toxiproxy container. For the initial tests this is not required, but we need it later on when we want to simulate network failures. For the sake of simplicity we will only use a single etcd node. In a production scenario you should have an etcd cluster of at least three nodes.
Run Linux Software Faster and Safer than Linux with Unikernels.
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.Project mention: Terraforming in 2021 – new features, testing and compliance | dev.to | 2021-05-02
Terratest is probably the closest one can get now a days to testing the specific peace of terraform code. It is a Go library, and requires one to write tests in Go. This is obviously a potential limitation as not all teams have knowledge in Go. On the upside, I would argue that the learning curve of learning Go to get the basics - read enough for writing terraform tests - is not steep if you know already at least one programming language.
BDD Testing Framework for Go
Quick and Easy server testing/validationProject mention: Find The Cube | dev.to | 2020-11-24
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:
Randomized testing for Go
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.
Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.Project mention: gRPC best practices | reddit.com/r/golang | 2021-04-21
Example auth middleware: https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/auth/examples_test.go
Sql mock driver for golang to test database interactionsProject mention: Go Package for better integration tests: github.com/ory/dockertest | dev.to | 2021-04-23
We have different ways to write our tests depending on what datastore we are using, for example if we are testing database calls that happen to be using database/sql then importing a package like github.com/DATA-DOG/go-sqlmock could work.
Automatically generate Go test boilerplate from your source code.Project mention: ¿Como estructurar tu aplicación en Go? | dev.to | 2021-05-09
Light weight cross-platform test automationProject mention: 9 Of The Best Java Testing Frameworks For 2021 | dev.to | 2021-05-14
Gauge is a Behavior Driven Java testing framework launched by ThoughtWorks.Inc. This is also one of the best Java Testing Frameworks, which allows software engineers to develop automated frameworks and speed up the software development procedure.
Package for comparing Go values in testsProject mention: Go Package for Equality: github.com/google/go-cmp | dev.to | 2021-03-03
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.
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
Write tests against structured configuration data using the Open Policy Agent Rego query languageProject mention: !!!*IMP: Conftest Integration with AWS or Other*!!!! | reddit.com/r/devopsish | 2021-06-18
OR HOW TO RUN https://github.com/open-policy-agent/conftest AS CI/CD in Circle CI to apply policies?
Lightweight service virtualization/API simulation tool for developers and testers
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-29
https://github.com/gavv/httpexpect End-to-end HTTP and REST API testing for Go.
A Devtools driver for web automation and scrapingProject mention: Rod: A Devtools driver for web automation and scraping | news.ycombinator.com | 2021-04-21
Martian is a library for building custom HTTP/S proxiesProject mention: A very simple uptime monitor written with go | reddit.com/r/golang | 2021-04-21
Future plans I have is for these workers to actually run chromedp (https://github.com/chromedp/chromedp) or something similar to generate a har file. Currently the har file can't be generated with chromedp but you could use a proxy like martian (https://github.com/google/martian) maybe to generate this. Then you could results like https://tools.pingdom.com/ (the tool seems not to show each file request for me anymore) for every uptime check and keep stats for this. You are not only testing the uptime then but also the full load time of the page along with checking for other potential problems.
What are some of the best open-source Testing projects in Go? This list will help you: