Go Testing

Open-source Go projects categorized as Testing

Top 23 Go Testing Projects

  • GitHub repo learn-go-with-tests

    Learn Go with test-driven development

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

  • GitHub repo 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: 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

  • GitHub repo Testify

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

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

  • GitHub repo GoConvey

    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?

  • GitHub repo chromedp

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

    Project mention: Docker run ภายใต้ network ของ container อื่น | dev.to | 2021-05-06
  • GitHub repo gomock

    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.

  • GitHub repo toxiproxy

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

  • GitHub repo terratest

    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.

  • GitHub repo ginkgo

    BDD Testing Framework for Go

    Project mention: Half a million lines of Go at The Khan Academy | news.ycombinator.com | 2021-05-16

    The BDD testing framework Ginko [1] has some "weird" / unidiomatic patterns, yet it is very popular


  • GitHub repo goss

    Quick and Easy server testing/validation

    Project 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:

  • GitHub repo go-fuzz

    Randomized testing for Go

    Project mention: Go: Fuzzing Is Beta Ready | news.ycombinator.com | 2021-06-04

    > it shows the limitations of the language that you can't just build this inside the language.

    Not sure why you'd make that assumption. https://github.com/dvyukov/go-fuzz

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

  • GitHub repo go-grpc-middleware

    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

  • GitHub repo go-sqlmock

    Sql mock driver for golang to test database interactions

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

  • GitHub repo gotests

    Automatically generate Go test boilerplate from your source code.

    Project mention: ¿Como estructurar tu aplicación en Go? | dev.to | 2021-05-09
  • GitHub repo Gauge

    Light weight cross-platform test automation

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

  • GitHub repo go-cmp

    Package for comparing Go values in tests

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

  • GitHub repo selenoid

    Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.

  • GitHub repo conftest

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

    Project 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?

  • GitHub repo hoverfly

    Lightweight service virtualization/API simulation tool for developers and testers

  • GitHub repo 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-29

    https://github.com/gavv/httpexpect End-to-end HTTP and REST API testing for Go.

  • GitHub repo rod

    A Devtools driver for web automation and scraping

    Project mention: Rod: A Devtools driver for web automation and scraping | news.ycombinator.com | 2021-04-21
  • GitHub repo martian

    Martian is a library for building custom HTTP/S proxies

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

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 2021-06-18.


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

Project Stars
1 learn-go-with-tests 14,482
2 Gor 14,264
3 Testify 13,533
4 GoConvey 6,415
5 chromedp 6,362
6 gomock 5,680
7 toxiproxy 5,495
8 terratest 5,307
9 ginkgo 4,829
10 goss 4,380
11 go-fuzz 4,055
12 realize 4,033
13 go-grpc-middleware 3,661
14 go-sqlmock 3,564
15 gotests 3,262
16 Gauge 2,503
17 go-cmp 2,328
18 selenoid 1,914
19 conftest 1,783
20 hoverfly 1,748
21 httpexpect 1,701
22 rod 1,597
23 martian 1,511
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives