~/talk

How to test Go code with a database?

TalkinRussianat HighLoad++ 2023 · 2023-11-27..11-28· [testing, go]
links:none on file
slides:none on file

Shows how to test Go code that interacts with a database by reducing reliance on fragile mocks and making tests easier to maintain as the codebase evolves. Describes techniques and approaches in Go for improving flexibility of changes and strengthening test guarantees when database access is involved.

AI-written summary · about

  1. 0:00Introduction
  2. 1:09Mocking problems in Go
  3. 3:26Test database choice
  4. 6:34Test DB connection setup
  5. 8:02DB cleanup methods
  6. 13:04Cleanup methods compared
  7. 15:56Parallel test execution
  8. 17:41CI test organization
  9. 19:51PostgreSQL speed tips
  10. 23:06Summary of integration tests
  11. 24:56Implementation tips
  12. 26:46Code examples & resources
  13. 27:14Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.