|
You are here |
markphelps.me | ||
| | | | |
benhoyt.com
|
|
| | | | | My re-implementation of the code from the official Go tutorial 'Developing a RESTful API with Go and Gin', using only the standard library, adding tests, and fixing issues. | |
| | | | |
mfbmina.dev
|
|
| | | | | Nowadays, a huge part of a developer's work consists in calling APIs, sometimes to integrate with a team within the company, sometimes to build an integration with a supplier. The other big role in daily work is to write tests. Tests ensure (or should guarantee :D) that all the code written by us works on how it is expected and, therefore, it will not happen any surprises when the feature is running at production environment. | |
| | | | |
konradreiche.com
|
|
| | | | | There are different ways of separating integration tests from your unit tests in Go. After discovering too many issues with some of the approaches I have settled with the following. func TestDatabase(t *testing.T) { integrationTest(t) // ... } func integrationTest(t *testing.T) { t.Helper() if os.Getenv("INTEGRATION") == "" { t.Skip("skipping integration tests, set environment variable INTEGRATION") } } Integration tests are marked as such at the top of the test function, similar to using t.Helper(). A test helper function is used to skip the test unless the environment variable is set. All tests, including integration tests, can be run with: | |
| | | | |
gist.github.com
|
|
| | | Rename Roam daily files to Obsidian daily files. GitHub Gist: instantly share code, notes, and snippets. | ||