{"id":15034462,"url":"https://github.com/antosdaniel/go-presentation-beyond-unit-tests","last_synced_at":"2026-03-16T22:34:45.167Z","repository":{"id":191916479,"uuid":"659873510","full_name":"antosdaniel/go-presentation-beyond-unit-tests","owner":"antosdaniel","description":"A dive into integration and end-to-end testing in Go.","archived":false,"fork":false,"pushed_at":"2023-10-28T17:46:00.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T06:43:15.481Z","etag":null,"topics":["e2e-tests","golang-examples","integration-tests"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antosdaniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-28T18:48:44.000Z","updated_at":"2023-10-05T18:06:52.000Z","dependencies_parsed_at":"2023-09-01T14:26:51.807Z","dependency_job_id":"8b469c33-7344-4606-9d64-20d2fba408fc","html_url":"https://github.com/antosdaniel/go-presentation-beyond-unit-tests","commit_stats":null,"previous_names":["antosdaniel/go-presentation-beyond-unit-tests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antosdaniel%2Fgo-presentation-beyond-unit-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antosdaniel%2Fgo-presentation-beyond-unit-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antosdaniel%2Fgo-presentation-beyond-unit-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antosdaniel%2Fgo-presentation-beyond-unit-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antosdaniel","download_url":"https://codeload.github.com/antosdaniel/go-presentation-beyond-unit-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243384318,"owners_count":20282335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e2e-tests","golang-examples","integration-tests"],"created_at":"2024-09-24T20:25:07.808Z","updated_at":"2025-12-29T22:21:21.348Z","avatar_url":"https://github.com/antosdaniel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go presentation: Beyond unit tests [![Go](https://github.com/antosdaniel/go-presentation-beyond-unit-tests/actions/workflows/go.yaml/badge.svg)](https://github.com/antosdaniel/go-presentation-beyond-unit-tests/actions)\n\nA dive into integration and end-to-end testing in Go.\n\n[Slides](https://slides.com/antosdaniel/beyond-unit-tests)\n\n[Presentation at Poznań Go Devs #9](https://www.youtube.com/watch?v=_Z21rm0FS_E)\n\n## Walkthrough\n\n[app_to_test](./app_to_test) contains very simple web application. It's expense\ntracker, with small HTTP API. Don't take too many of these ideas to production 🙃\nYou can play with it through [expenses.http](app_to_test%2Fexpenses.http).\n\nFirst suite of test to check out is [test_repos](./test_repos). It uses test \ncontainers to spin up Postgres database and checks if repository works as promised.\nIt's a good tool for more complex SQL queries, or testing against concurrency issues.\n\nNext one is [test_http_api](test_http_api). It includes database trick from\nprevious suite, but also spins up API. Explored idea here is how to keep tests\nlike these easy to read, and not a chore to write (at least, after the first one).\n\nFinal one is [test_e2e](test_e2e). We are spinning up whole application, and\nrunning tests against that. To make things even more interesting, we are stubing\nexternal API for better reliability. This checks that our application starts correctly, \nand that all the components work together. It's certainly more complex, not as\nquick to write, nor run. Use them sparingly, to make sure that crucial parts\nof your application work as expected. These could also be named smoke tests.\n\n## Requirements\n\n- Go 1.21\n- Docker Desktop 24+\n\n## Start application\n\n```shell\ndocker compose up\n```\n\n## Run tests\n\nRun unit tests:\n\n```shell\ngo test ./...\n```\n\nRun e2e tests:\n\n```shell\nPKGS=$(git grep --files-with-matches \"//go:build e2e_tests\" -- \"*.go\" | xargs dirname | sed 's,^,./,g' | sort -u)\ngo test -tags=e2e_tests $PKGS\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosdaniel%2Fgo-presentation-beyond-unit-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantosdaniel%2Fgo-presentation-beyond-unit-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosdaniel%2Fgo-presentation-beyond-unit-tests/lists"}