Integration test

An integration test exercises multiple parts of an application together through a real dependency, such as calling a running HTTP API that reads from MySQL. It verifies interactions that unit tests with fake dependencies cannot establish.

Minimal example

go
if os.Getenv("TEST_MYSQL_DSN") == "" {
	t.Skip("set TEST_MYSQL_DSN to run")
}

Learn this concept

Lesson 2.18 · HTTP integration tests with MySQL fixtures

Used in exercises

Exercise 2.19 · Restaurant list integration suite Exercise 2.24 · GET /v1/restaurants: search by name Exercise 2.26 · GET /v1/restaurants: sort by distance