Rationale
Integration tests verify that components work together correctly. GitLab requires integration tests for all service boundaries.
Requirements
- All API endpoints must have integration tests
- Database operations must have integration tests
- External service integrations must have integration tests with recorded responses
- Integration tests must run in CI pipeline
What Counts as Integration Test
- API endpoint tests (HTTP request/response)
- Database CRUD operation tests
- Message queue producer/consumer tests
- Cache layer tests
- Third-party API integration tests (with recorded responses)
Test Environment
- Use test containers or dedicated test databases
- Never test against production data
- Clean up test data after each test run
References
- Testing Standards: https://handbook.gitlab.com/handbook/engineering/testing/