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

    github.com/stretchr/testify

  • learn-go-with-tests

    Learn Go with test-driven development

  • Project mention: [Go, Book Review] Learn Go with Tests by Chris James | dev.to | 2024-03-23

    There are not particularly bad parts. Overall the book is well written and organized. Moreover, Since it is also an open-source material, many readers have contributed to the contents of the book(including a few of mine :)). I hope there are more books like this for other languages such as Rust or Python.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

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

  • chromedp

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

  • toxiproxy

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

  • Project mention: Speedbump – a TCP proxy to simulate variable network latency | news.ycombinator.com | 2024-01-16

    Checkout also shopify's awesome tool called toxiproxy: https://github.com/Shopify/toxiproxy

    It turns out to be also a very good way to test a networking library by implementing it. Since your stack needs to be able to basically handle most adverse events properly.

    The idea behind 'chaos engineering' is cool.

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

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • terratest

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

  • Project mention: Top Terraform Tools to Know in 2024 | dev.to | 2024-03-26

    Terratest is a Go library that provides tools and patterns for testing infrastructure, with first-class support for Terraform, Packer, Docker, Kubernetes, and more. It's used to write automated tests for your infrastructure code.

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

    A mock code autogenerator for Go (by vektra)

  • Project mention: I Write Tests in Go | news.ycombinator.com | 2024-04-10

    I'm far too lazy to write mocks by hand in go. You can generate a mock for a given interface with mockery https://github.com/vektra/mockery

  • 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

  • syzkaller

    syzkaller is an unsupervised coverage-guided kernel fuzzer

  • Project mention: Automated Unit Test Improvement Using Large Language Models at Meta | news.ycombinator.com | 2024-02-17

    https://arxiv.org/abs/2402.09171 :

    > This paper describes Meta's TestGen-LLM tool, which uses LLMs to automatically improve existing human-written tests. TestGen-LLM verifies that its generated test classes successfully clear a set of filters that assure measurable improvement over the original test suite, thereby eliminating problems due to LLM hallucination. [...] We believe this is the first report on industrial scale deployment of LLM-generated code backed by such assurances of code improvement.

    Coverage-guided unit test improvement might [with LLMs] be efficient too.

    https://github.com/topics/coverage-guided-fuzzing :

    - e.g. Google/syzkaller is a coverage-guided syscall fuzzer: https://github.com/google/syzkaller

    - Gitlab CI supports coverage-guided fuzzing: https://docs.gitlab.com/ee/user/application_security/coverag...

    - oss-fuzz, osv

    Additional ways to improve tests:

    Hypothesis and pynguin generate tests from type annotations.

    There are various tools to generate type annotations for Python code;

    > pytype (Google) [1], PyAnnotate (Dropbox) [2], and MonkeyType (Instagram) [3] all do dynamic / runtime PEP-484 type annotation type inference [4] to generate type annotations. https://news.ycombinator.com/item?id=39139198

    icontract-hypothesis generates tests from icontract DbC Design by Contract type, value, and invariance constraints specified as precondition and postcondition @decorators:

  • 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

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

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

  • 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: Testcontainers | news.ycombinator.com | 2024-02-27

    I am using https://github.com/ory/dockertest for tests, specifically for databases. Is there any advantage to use Testcontainers?

  • keploy

    Test generation for Developers. Generate tests and stubs for your application that actually work!

  • Project mention: Getting Started with Keploy | dev.to | 2024-02-12

    October is the month of Open Source and Keploy is taking part in this celebration. You can contribute to several Keploy projects by participating in this year’s Hacktoberfest. You can both contribute to the code part and the no-code part as well. Here are some contributions that you can make!

  • testcontainers-go

    Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

  • Project mention: Using test helpers in Go | dev.to | 2024-02-16

    Let's first look at the original version of the test, in this case, an end-to-end, using testcontainers.

  • 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

  • SaaSHub

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

    SaaSHub logo
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).

Go Testing related posts

Index

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

Project Stars
1 Testify 22,019
2 learn-go-with-tests 21,228
3 Gor 18,279
4 chromedp 10,341
5 toxiproxy 10,300
6 GoConvey 8,100
7 ginkgo 7,911
8 terratest 7,330
9 go-grpc-middleware 6,043
10 go-sqlmock 5,827
11 mockery 5,608
12 goss 5,441
13 syzkaller 5,124
14 gotests 4,849
15 rod 4,784
16 go-fuzz 4,705
17 realize 4,436
18 HTTPLab 3,981
19 go-cmp 3,975
20 dockertest 3,967
21 keploy 3,316
22 testcontainers-go 3,040
23 Gauge 2,941

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com