Go Testing

Open-source Go projects categorized as Testing

Top 23 Go Testing Projects

  • learn-go-with-tests

    Learn Go with test-driven development

    Project mention: Please share programming/CS books and articles that use Go as examples(but not strictly about Go) | reddit.com/r/golang | 2022-10-23

    I really like Learn Go with tests. Not only is it a neat resource for learning Go, but it's great for getting a feeling for TDD.

  • Testify

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

    Project mention: Criando uma API Rest com Fiber - Uma história pessoal de aprendizado | dev.to | 2022-11-22
  • Zigi

    Workflow assistant built for devs & their teams. Automate the mundane part of your day, with live actionable messages for your GitHub & Jira tasks.

  • 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: Ask HN: How do you do Load Testing this 2022? | news.ycombinator.com | 2022-07-10
  • toxiproxy

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

    Project mention: Performance testing with slow connection and packet loss | reddit.com/r/softwaretesting | 2022-08-17

    We use this thing. https://github.com/Shopify/toxiproxy I am not sure that it supports windows, but you can install it to the Linux machine and route your application under the test to that proxy.

  • chromedp

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

    Project mention: How can I do infinte scroll with go http | reddit.com/r/golang | 2022-11-16

    You could use something like the chrome dev tools (https://github.com/chromedp/chromedp) or look into JS runtimes in Go and try to handle the I/O yourself.

  • gomock

    GoMock is a mocking framework for the Go programming language. (by golang)

    Project mention: Comprehensive Guide to Testing in Go | reddit.com/r/golang | 2022-11-22

    gomock can also be great for testing when used sparingly. Mocking out one or two calls is great, anymore than that and it becomes exponentially harder to reason about

  • GoConvey

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

    Project mention: Is there a more detailed test coverage report than go test -cover? | reddit.com/r/golang | 2022-08-01

    IIRC you can use http://goconvey.co/ just for the reports

  • Scout APM

    Truly a developer’s best friend. Scout APM is great for developers who want to find and fix performance issues in their applications. With Scout, we'll take care of the bugs so you can focus on building great things 🚀.

  • ginkgo

    A Modern Testing Framework for Go

    Project mention: Testing frameworks, which to use? | reddit.com/r/golang | 2022-02-28

    https://onsi.github.io/ginkgo/ offers a simple way to create tables with different scenarios useful to generate different test cases based on a file like a yml without to need to develop useless code. Maybe at start seems to be a little verbose but depends how you design the test case.

  • terratest

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

    Project mention: Alternative to InSpec: what do you use to "assert things have been correctly configured"? | reddit.com/r/devops | 2022-11-23
  • go-grpc-middleware

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

  • goss

    Quick and Easy server testing/validation

    Project mention: Alternative to InSpec: what do you use to "assert things have been correctly configured"? | reddit.com/r/devops | 2022-11-23

    I've used https://github.com/goss-org/goss in the past and enjoyed it

  • go-sqlmock

    Sql mock driver for golang to test database interactions

    Project mention: Creating an API using Go and sqlc | dev.to | 2022-10-24

    For that, I used the lib go-sqlmock. So, for example, the following snippet is part of the person/service_test.go file:

  • go-fuzz

    Randomized testing for Go

    Project mention: Go Fuzz Testing – The Basics | news.ycombinator.com | 2022-03-29

    It does instrumented fuzzing. The older https://github.com/dvyukov/go-fuzz would rewrite your sources to inject the instrumentation and pass the rewritten sources to the compiler, but it didn't really work with Go modules. This is something that probably makes sense to integrate with the compiler toolchain, same as `go test`'s coverage testing.

  • syzkaller

    syzkaller is an unsupervised coverage-guided kernel fuzzer

    Project mention: Linux System Call Table – Chromiumos | news.ycombinator.com | 2022-10-30
  • 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.

  • gotests

    Automatically generate Go test boilerplate from your source code.

    Project mention: [gopher.nvim] Plugin for golang development | reddit.com/r/neovim | 2022-06-22

    What can do this plugin? - Modify struct tags. - Run go get, go mod & go generate commands inside of nvim. - Implement interface by impl. - Generate tests by gotests. - Install required tools for plugin working(by go install).

  • mockery

    A mock code autogenerator for Golang (by vektra)

    Project mention: How do you write/generate mocks for testing? | reddit.com/r/golang | 2022-09-21

    My bread and butter is mockery (https://github.com/vektra/mockery). It has a few shortcomings (a config would be really nice in my project) which should be fixed in v3 (https://github.com/vektra/mockery#v3).

  • go-cmp

    Package for comparing Go values in tests

    Project mention: Visualizing Diffs The Myers difference algorithm | news.ycombinator.com | 2022-11-03

    This made me think of a couple other interesting things:

    1. you can change which algorithm is used in git diff as multiple are supported

    https://luppeng.wordpress.com/2020/10/10/when-to-use-each-of...

    2. Google has an edit graph implementation in Go in the cmp package

    https://github.com/google/go-cmp/blob/master/cmp/internal/di...

  • rod

    A Devtools driver for web automation and scraping

    Project mention: Go for web scraping | reddit.com/r/golang | 2022-11-18

    I recently tried out https://github.com/go-rod/rod. I think it's based on chromedp (so, Chrome dev tools and headless browser) but it also has code to download and run a supported version of Chrome that doesn't interfere with your local browser.

  • Gauge

    Light weight cross-platform test automation

    Project mention: Java Developer, What do you do? | reddit.com/r/developersIndia | 2022-10-24

    Since the project also uses Postgres, Redis, and AMQP, we also write integration tests. A docker compose file is there to stack up the test suite, and before each test, the tables, the keys, and the queues are reset. We don't try to aim to test for all the cases but usually all the controllers are covered. I personally would prefer to write more test cases between multiple micro services (e2e?) using something like Gauge but these integration tests are kind of enough.

  • conftest

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

    Project mention: Introducing Conftest and setting up CI with Github Actions to automate reviewing of Terraform code | dev.to | 2021-12-28

    name: tf-plan-apply on: pull_request: branches: [ main ] env: TF_VERSION: 1.0.0 CONFTEST_VERSION: 0.28.3 WORKING_DIR: ./ jobs: terraform: name: aws-eureka-pairs-etc-s3 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/[email protected] - name: Install conftest run: | wget -O - 'https://github.com/open-policy-agent/conftest/releases/download/v${{ env.CONFTEST_VERSION }}/conftest_${{ env.CONFTEST_VERSION }}_Linux_x86_64.tar.gz' | tar zxvf - ./conftest --version //❶ - name: Setup Terraform uses: hashicorp/[email protected] with: terraform_wrapper: false //❷ terraform_version: ${{ env.TF_VERSION }} cli_config_credentials_token: ${{ secrets.YOUR_CRED_NAME}} - name: Terraform Init ${{ env.WORKING_DIR }} working-directory: ${{ env.WORKING_DIR }} run: terraform init - name: Terraform Plan ${{ env.WORKING_DIR }} if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} working-directory: ${{ env.WORKING_DIR }} id: plan run: terraform plan -out=tfplan -no-color -lock=false -parallelism=50 - name: Convert terraform plan result to json formmat if: github.event_name == 'pull_request' id: convert working-directory: ${{ env.WORKING_DIR }} run: terraform show -json tfplan > tfplan.json - name: conftest test if: github.event_name == 'pull_request' id: conftest run: ./conftest test --no-color ${{ env.WORKING_DIR }}/tfplan.json //❸

  • pumba

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

    Project mention: Docker networks explained - part 2: docker-compose, microservices, chaos monkey | dev.to | 2022-03-15

    I highly recommend looking at Pumba a project that lets you pause services, kill them, but also add network delay, loss, corruption etc.

  • selenoid

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

    Project mention: Thoughts on Go headless browser tools for testing and scraping? | reddit.com/r/golang | 2022-10-14

    On a related note, there's selenoid used for launching browsers in docker containers: https://github.com/aerokube/selenoid

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

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 2022-11-23.

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 learn-go-with-tests 18,782
2 Testify 18,295
3 Gor 16,426
4 toxiproxy 8,712
5 chromedp 8,383
6 gomock 8,258
7 GoConvey 7,515
8 ginkgo 6,618
9 terratest 6,515
10 go-grpc-middleware 5,039
11 goss 4,975
12 go-sqlmock 4,842
13 go-fuzz 4,515
14 syzkaller 4,452
15 realize 4,317
16 gotests 4,311
17 mockery 4,096
18 go-cmp 3,213
19 rod 3,179
20 Gauge 2,770
21 conftest 2,460
22 pumba 2,405
23 selenoid 2,262
Build time-series-based applications quickly and at scale.
InfluxDB is the Time Series Data Platform where developers build real-time applications for analytics, IoT and cloud-native services in less time with less code.
www.influxdata.com