SaaSHub helps you find the best software and product alternatives Learn more →
Top 8 Go Tdd Projects
Learn Go with test-driven developmentProject mention: Offline Resources for Learning Go | reddit.com/r/golang | 2023-03-02
Sql mock driver for golang to test database interactionsProject 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:
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.
Quick and Easy server testing/validationProject mention: Is docker the right tool for my use case? (testing an installscript) | reddit.com/r/docker | 2023-01-22
Docker would work. I suggest also integrating infrastructure tests to validate your install script behaved as expected. For example, you could use goss.
Immutable transaction isolated sql driver for golangProject mention: Integration Tests with Postgres | reddit.com/r/golang | 2023-03-29
3 years ago I created a internal library where I worked to setup the testing with the db's. One param was the schema directory and the other one was the path of the data insertion file. It worked really well but was a little slow. It was a little bit weird to configure the container to run the tests. As I would have to give access to go container that ran the unit tests access to docker. But back then I was running boot2docker and made things very cumbersome. I think with a local docker things would be way simpler. I ended up using and normal DB from the CI/CD and https://github.com/DATA-DOG/go-txdb If I had to do it again I might do an hybrid in-between the two solutions
pgx mock driver for golang to test database interactionsProject mention: Using SQLC in project how do I mock database Calls with it for unit testing? | reddit.com/r/golang | 2022-10-22
It's not the right call IMO to skip mocking the database connection to achieve 100% test coverage. How your app will behave in failure scenarios that are impossible to imitate during integration tests is part of the software contract. If your choice is to panic, or return an error, document that by testing that behavior. If another dev, or future you inadvertently breaks the contract, the test suite will fail. That's what you want. For unit tests against your database you should be using either go-sqlmock if testing against database/sql or pgxmock if testing against pgx. That being said, the points raised elsewhere in this thread regarding unit tests potentially hiding edge cases in terms of how an actual database will interact with your application that are not reflective of your understanding when writing mocks are 100% valid. You should do both. Unit test your app and write integration tests as well. On my team, we run integration tests using docker-compose.
testcase is an opinionated testing framework to support test driven design.Project mention: testing utility for time manipulation and pretty printing | reddit.com/r/golang | 2022-08-12
One of them focuses on time manipulation for testing purposes: - Freeze time to a specific point. - Travel back to a specific time, but allow time to continue moving forward. - Scale time by a given scaling factor will cause the time to move at an accelerated pace. - No dependencies other than the stdlib - Nested calls to timecop.Travel is supported - Works with any regular Go projects
Library created for testing JSON against patterns.
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
This repo shows how to test and mock multiple dependencies using table-driven tests with testify-mock in Golang
Go Tdd related posts
Offline Resources for Learning Go
2 projects | reddit.com/r/golang | 2 Mar 2023
Why unit test flask app?
2 projects | reddit.com/r/Python | 23 Feb 2023
Is docker the right tool for my use case? (testing an installscript)
1 project | reddit.com/r/docker | 22 Jan 2023
Portable security testing tooling (not chef inspec)
1 project | reddit.com/r/devsecops | 22 Nov 2022
Please share programming/CS books and articles that use Go as examples(but not strictly about Go)
1 project | reddit.com/r/golang | 23 Oct 2022
Using SQLC in project how do I mock database Calls with it for unit testing?
3 projects | reddit.com/r/golang | 22 Oct 2022
Learn Go with Tests: Scaling acceptance tests (with a light intro to gRPC)
1 project | reddit.com/r/golang | 17 Oct 2022
A note from our sponsor - #<SponsorshipServiceOld:0x00007f160cc05ea8>
www.saashub.com | 1 Apr 2023
What are some of the best open-source Tdd projects in Go? This list will help you: