~/talk

Ditch SQLite! Write Reliable EF Core Tests with Testcontainers

Talkat JetBrains .NET Days Online 2024 · 2024-09-25..09-26· [testing, databases]
slides:none on file

Argues that SQLite gives false positives for production SQL engines and shows a concrete replacement: spin up Testcontainers Postgres instances in xUnit, use the implicit Ryuk reaper to auto-clean containers, and run fast state resets with Respawn. Demo covers connection-string plumbing, class/collection fixture strategies, optional reusable containers, Podman caveat, and performance: 10,000-row insert/delete runs ~1m7s on a desktop with ~3–5s container overhead. Tests pass once state bleed is fixed with Respawn.

AI-written summary · about

  1. 0:00Introduction
  2. 2:14SQLite in tests problems
  3. 6:09Testing with different SQL engine
  4. 9:43Testing database options overview
  5. 10:26Testcontainers and why use it
  6. 13:15Demo project setup
  7. 16:26Testcontainers in integration tests
  8. 19:59First test with Testcontainers
  9. 23:14Fixing state bleed
  10. 26:50Respawn for cleanup
  11. 33:21Improving test structure
  12. 37:25Performance testing with Testcontainers
  13. 40:38Key points recap
  14. 42:22Q&A
  15. 45:58Q&A
  16. 51:38Q&A
  17. 55:31Closing remarks
~/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.