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. Learn more →
Top 23 Go Testing Projects
-
github.com/stretchr/testify
-
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-17I 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.
Cheers!
-
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 -
-
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 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-02I think I found it. This is the one right? https://github.com/gruntwork-io/terratest/
-
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 )
-
Project mention: How do you unit-test code that reaches out to the db, without introducing interfaces everywhere? | /r/golang | 2023-08-16
-
Certain checks may be possible with goss and the kgoss wrapper: https://github.com/goss-org/goss/tree/master/extras/kgoss
-
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
-
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
-
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".
-
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.
-
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.
-
-
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
Now, let's run the tests. For this purpose, we are going to use dockertest, but test containers is also a good solution.
-
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
I wrote following conftest.dev (OPA), sample policy
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Go Testing related posts
- Russ Cox: Go Testing by Example
- Chart Testing (ct tool) fail to list changed chart
- Synchronize" a 3D scene across multiple windows using Three.js and localStorage
-
httpbin alternatives - go-httpbin and java-httpbin
3 projects | 12 Nov 2023
- Show HN: Keploy – eBPF-Driven API Mock and Test Generation from Prod Traffic
- Seeking API Ideas to Test the E2E Testing Framework
- Level Up Node.js E2E and Integration Testing with OpenTelemetry
-
A note from our sponsor - InfluxDB
www.influxdata.com | 9 Dec 2023
Index
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 |