Go Testing

Open-source Go projects categorized as Testing

Top 23 Go Testing Projects

  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

    Project mention: What 3rd-party libraries do you use often/all the time? | /r/golang | 2023-12-01


  • learn-go-with-tests

    Learn Go with test-driven development

    Project mention: quii/learn-go-with-tests: Learn Go with test-driven development | /r/devopsish | 2023-08-20
  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • 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.

    Project mention: Launch HN: Codeparrot (YC W23) – Automated API testing using production traffic | news.ycombinator.com | 2023-03-17

    I love to see more activity in this area!

    I'm maintainer of GoReplay https://github.com/buger/goreplay and work in this area for the last 10 years.

    It is quite hard problem to solve, because you have to deal with state difference between test and production environments. Love your approach to mocking dependencies, and leveraging OpenTelementry. It potentially can solve some of state issues. But still require modifying user code. I wonder if it can be done purely using OpenTelementry (e.g. you depend on typical OTel setup), and then read the data directly from OTel DB.


  • toxiproxy

    :alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

    Project mention: Toxiproxy – simulate network and system conditions for chaos testing | /r/hypeurls | 2023-10-13
  • chromedp

    A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.

    Project mention: Web scraping with Go | /r/golang | 2023-04-02
  • GoConvey

    Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.

    Project mention: Gokiburi: Automatic Test Runs for Go Projects | /r/golang | 2023-05-07

    I have always liked to use the similar GoConvey tool for automatic test runs during development, but it has definitely started to “show its age” and since Go 1.20 it hasn’t been able to parse code coverage correctly. So, I decided to dive into making my own tool to replace it for me.

  • ginkgo

    A Modern Testing Framework for Go

    Project mention: Writing tests for a Kubernetes Operator | dev.to | 2023-10-07

    Ginkgo: a testing framework based on the concept of ‌"Behavior Driven Development" (BDD)

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.

  • terratest

    Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.

    Project mention: Saw a not-so-good thing in my pipeline. How do we fix it? | /r/Terraform | 2023-06-02

    I think I found it. This is the one right? https://github.com/gruntwork-io/terratest/

  • go-grpc-middleware

    Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.

    Project mention: Seeking advice on implementing a tinyurl-like service using Go and gRPC. | /r/golang | 2023-05-24

    Hello, Those interviews are even crazy for internship. Anyway 1. Try to find a simple CRUD example online. You can check [this](https://tutorialedge.net/golang/go-grpc-beginners-tutorial/) 2. For logging you can check [go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) 3. You can grpc-gateway in case they want some REST endpoints too 4. Use base62 to encode your url. So at least 2 columns in your table **shortenedUrl** and **url** 5. For such a project no need to use an ORM ( it's not advised anyway ). Implement 2 functions, one to insert into the db and the other one to read from the db. Remember to use transaction though 5. For unit tests go with the standard library and mock the 2 functions ( erroneous and valid cases )

  • go-sqlmock

    Sql mock driver for golang to test database interactions

    Project mention: How do you unit-test code that reaches out to the db, without introducing interfaces everywhere? | /r/golang | 2023-08-16
  • goss

    Quick and Easy server testing/validation

    Project mention: Tools for validating K8s features | /r/kubernetes | 2023-06-08

    Certain checks may be possible with goss and the kgoss wrapper: https://github.com/goss-org/goss/tree/master/extras/kgoss

  • mockery

    A mock code autogenerator for Go (by vektra)

    Project mention: go-ecommerce-microservices: A practical e-commerce microservices, built with cqrs, event sourcing, vertical slice architecture, event-driven architecture. | /r/golang | 2023-08-26

    Some of the features: - ✅ Using Vertical Slice Architecture as a high level architecture - ✅ Using Event Driven Architecture on top of RabbitMQ Message Broker with a custom [Event Bus](pkg/messaging/bus/) - ✅ Using Event Sourcing in Audit Based services like [Orders Service](services/orders/) - ✅ Using CQRS Pattern and Mediator Patternon top of Go-MediatR library - ✅ Using Dependency Injection and Inversion of Controlon top of uber-go/fx library - ✅ Using RESTFul api with Echo framework and using swagger with swaggo/swag library - ✅ Using Postgres and EventStoreDB to write databases with fully supports transactions(ACID) - ✅ Using MongoDB and Elastic Search for read databases (NOSQL) - ✅ Using OpenTelemetry for collection Distributed Tracing with using Jaeger and Zipkin - ✅ Using OpenTelemetry for collection Metrics with using Prometheus and Grafana - ✅ Using Unit Test for testing small units with mocking dependent classes and using Mockery for mocking dependencies - ✅ Using End2End Test and Integration Test for testing features with all of their real dependeinces using docker containers (cleanup tests) and testcontainers-go library

  • syzkaller

    syzkaller is an unsupervised coverage-guided kernel fuzzer

    Project mention: Fuzz Testing Is the Best Thing to Happen to Our Application Tests | news.ycombinator.com | 2023-08-17

    The key to modern fuzzing is feedback, usually some kind of coverage testing of the program under test. This allows the fuzzer to be much smarter about how it finds new code paths, and makes fuzzing find bugs a lot quicker.

    Google have a project to do fuzzing on Linux system calls using coverage feedback: https://github.com/google/syzkaller

  • gotests

    Automatically generate Go test boilerplate from your source code.

    Project mention: Russ Cox: Go Testing by Example | news.ycombinator.com | 2023-12-05

    A huge time-saver for me when generating table-driven test boilerplate in Go has been using gotests[0] to generate the template.

    If you use VSCode with the Go extension it's already available there as a command "Go: Generate Unit Tests for Function/Package".

    [0] https://github.com/cweill/gotests

  • go-fuzz

    Randomized testing for Go

    Project mention: Fuzzing in Go | /r/golang | 2023-06-10

    I used this method successfully for my qjson package . It accepts as input a human readable json. It detected a condition I forgot to check in a few minutes. I used the go fuzzer go-fuzz from Dmitry Vyukov. Check the impressive list of trophies at the end of the README. These are bugs found by the fuzzer.

  • 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.

  • rod

    A Devtools driver for web automation and scraping

    Project mention: Need help authenticating to Okta programatically. | /r/okta | 2023-07-03

    I have tried the following. 1. Login to Okta via browser programatically using go-rod. Which I managed to do so successfully, but I'm failing to load up Slack as it's stuck in the browser loader screen for Slack. 2. I tried to authenticate via Okta RESTful API. So far, I have managed to authenticate using {{domain}}/api/v1/authn, and then subsequently using MFA via the verify endpoint {{domain}}/api/v1/authn/factors/{{factorID}}/verify which returns me a sessionToken. From here, I can successfully create a sessionCookie which have proven quite useless to me. Perhaps I am doing it wrongly.

  • HTTPLab

    The interactive web server

  • go-cmp

    Package for comparing Go values in tests

  • dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

    Project mention: Level UP your RDBMS Productivity in GO | dev.to | 2023-12-05

    Now, let's run the tests. For this purpose, we are going to use dockertest, but test containers is also a good solution.

  • Gauge

    Light weight cross-platform test automation

    Project mention: Python-Selenium-Action: Run Selenium with Python via Github Actions using Headless or Non-Headless browsers! | /r/Python | 2023-05-03

    Selenium is cool but https://gauge.org/ really cuts down on the boilerplate and is a lot more lightweight, may want to give it a look too

  • conftest

    Write tests against structured configuration data using the Open Policy Agent Rego query language

    Project mention: Validation on list(object) variables | /r/Terraform | 2023-05-08

    I wrote following conftest.dev (OPA), sample policy

  • pumba

    Chaos testing, network emulation, and stress testing tool for containers

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-12-05.

Go Testing related posts


What are some of the best open-source Testing projects in Go? This list will help you:

Project Stars
1 Testify 21,057
2 learn-go-with-tests 20,565
3 Gor 17,966
4 toxiproxy 9,947
5 chromedp 9,809
6 GoConvey 7,966
7 ginkgo 7,617
8 terratest 7,207
9 go-grpc-middleware 5,808
10 go-sqlmock 5,587
11 goss 5,328
12 mockery 5,259
13 syzkaller 4,933
14 gotests 4,745
15 go-fuzz 4,669
16 realize 4,422
17 rod 4,382
18 HTTPLab 3,927
19 go-cmp 3,807
20 dockertest 3,769
21 Gauge 2,887
22 conftest 2,720
23 pumba 2,604
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives