ADR 0009: Integration-First Testing with Testcontainers + HttpMessageHandler Fakes

Status

Accepted — 2025-12-15

Context

This repository targets many providers and wants high-confidence coverage in CI and locally without requiring real cloud accounts or fragile SDK mocks.

Problem

  1. For “infrastructure-style” providers (Azure/AWS/GCS/SFTP), pure unit tests provide low confidence because behaviour depends on real protocol semantics.
  2. For cloud-drive APIs (Graph/Drive/Dropbox), running against real services is expensive and requires secrets, while mocking SDK methods is brittle.

Decision

We standardize on an integration-first test strategy:

flowchart TD
  Tests[Tests] --> Providers[Provider suites]
  Providers --> Containers[Testcontainers]
  Providers --> CloudDrive[CloudDrive suites]
  CloudDrive --> SDK[Official SDK client]
  SDK --> Handler[HttpMessageHandler fake]

Alternatives Considered

  1. Mock provider/SDK methods
    • Pros: easy to write.
    • Cons: tests validate mocks, not behaviour; fragile over time.
  2. Use real cloud accounts
    • Pros: highest fidelity.
    • Cons: secrets management; cost; flakiness; hard to run locally.
  3. Containers + HTTP fakes (chosen)
    • Pros: high fidelity without secrets; reproducible locally and in CI.
    • Cons: requires Docker for container suites; HTTP fakes must track API docs.

Consequences

Positive

Negative

References (Internal)