SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Go Testing Projects
-
Project mention: Full Introduction to Golang with Test-Driven Development | news.ycombinator.com | 2024-08-03
This article is too basic and does not introduce anything you'd encounter in a typical Go project. If you want introduction to Go testing I recommend just reading the official docs https://pkg.go.dev/testing and understanding how to write table driven tests - https://go.dev/wiki/TableDrivenTests.
Going beyond what's built in, get familiar with https://github.com/stretchr/testify as that's used a lot.
-
InfluxDB
Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
-
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.
-
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.
-
To my surprise the code was closer in structure to the puppeteer version than it was to the chromedp. The chromedp version uses nested context declarations to manage the browser and page runtimes, the rust version uses a more linear approach. You construct a browser instance and then you can interact with it as a user would. This points at the fact that the chromiumoxide api is higher level.
-
toxiproxy
:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
Project mention: (Mostly) Deterministic Simulation Testing in Go | news.ycombinator.com | 2024-05-30I really like an idea to solve scheduling problem via compiling to WASI. Many months ago I had conversation with friends, how to implement deterministic testing in Go, without custom IO runtime (common approach in Scala/Rust/C++). We were talking about a few random things, which require a lot of effort (compare to WASI):
1. https://github.com/Shopify/toxiproxy
2. https://github.com/bytedance/ns-x
3. https://github.com/hnes/cpuworker
But all of them are not too good from the first glance.
-
-
Ginkgo: a testing framework based on the concept of "Behavior Driven Development" (BDD)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
terratest
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.
The Terratest Go library leverages this to define a variety of test cases used to test Docker images, cloud infrastructure defined for AWS, Azure, GCP, Kubernetes, and many more.
-
-
Project mention: Princípios SOLID em GoLang - Dependency Inversion Principle (DIP) | dev.to | 2024-08-03
-
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
-
-
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:
-
-
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
-
-
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.
-
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
I am using https://github.com/ory/dockertest for tests, specifically for databases. Is there any advantage to use Testcontainers?
-
-
keploy
Shadow Test generation for Developers. Generate tests and stubs for your application that actually work!
Project mention: Developer's Guide to Smoke Testing: Ensuring Core Functionality | dev.to | 2024-08-26### Keploy
-
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: Testcontainers-Go: Effortless Container-Based Testing for Go Developers | news.ycombinator.com | 2024-08-14 -
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Go Testing discussion
Go Testing related posts
-
I curate a daily newsletter with resources about Golang - Daily Golang. Here are the latest 6 issues of the newsletter
-
Testcontainers-Go: Effortless Container-Based Testing for Go Developers
-
Princípios SOLID em GoLang - Dependency Inversion Principle (DIP)
-
Full Introduction to Golang with Test-Driven Development
-
Go mock
-
Understanding Tdd vs Bdd : A Guide For Developers
-
Effortless HTTP Client Testing in Go
-
A note from our sponsor - SaaSHub
www.saashub.com | 7 Sep 2024
Index
What are some of the best open-source Testing projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | Testify | 22,960 |
2 | learn-go-with-tests | 21,947 |
3 | Gor | 18,533 |
4 | chromedp | 10,812 |
5 | toxiproxy | 10,587 |
6 | GoConvey | 8,222 |
7 | ginkgo | 8,213 |
8 | terratest | 7,451 |
9 | go-grpc-middleware | 6,247 |
10 | go-sqlmock | 6,035 |
11 | mockery | 5,947 |
12 | goss | 5,550 |
13 | syzkaller | 5,287 |
14 | rod | 5,184 |
15 | gotests | 4,918 |
16 | go-fuzz | 4,751 |
17 | realize | 4,454 |
18 | go-cmp | 4,149 |
19 | dockertest | 4,085 |
20 | HTTPLab | 4,024 |
21 | keploy | 3,854 |
22 | testcontainers-go | 3,458 |
23 | Gauge | 2,968 |