ef8a68fb

By: Michael Lynch <git@mtlynch.io>

Exercise production adapters in a reproducible test tier

The unit and browser suites left important production boundaries largely untested: AWS SDK request construction, SMTP STARTTLS and authentication, real ffprobe output, command exit behavior, and race-enabled reproducible Go checks. Failures in those paths could reach deployment despite strong business-logic coverage.

Litestream v0.5.14 in files replica_client_test.go, s3/replica_client_test.go, and tests/integration/quick_test.go separates fast unit tests, backend contract tests, tagged integrations, provider tests, and nightly race or soak jobs. Its S3 tests use local HTTP servers to inspect actual SDK requests, while heavier suites are selected explicitly. Adopt that tiering without copying Docker, real-cloud, sleep-driven, or soak complexity that is disproportionate for this service.

Add integration-tagged loopback tests for S3 request method, key, headers, and body; a local TLS SMTP peer that verifies STARTTLS, credentials, envelope, and message content; a real ffprobe test against the fixed video fixture; and a Tinybeans CLI subprocess flow. A non-Nix runner owns the tagged command, and a new integration-tests flake package supplies pinned operational dependencies. The existing Nix go-tests target now uses the repository's --full mode so race detection and coverage share the canonical test script.

The main implementation issues were making protocol tests realistic without becoming flaky. SMTP required a test certificate authority trusted through SSL_CERT_FILE rather than disabling verification. Servers signal readiness through successful Listen and communicate through channels with deadlines instead of sleeps. The Nix fileset had to include tagged tests, fixtures, scripts, and command inputs, while keeping external programs out of the normal unit tier. Race checks increase CI cost but remain isolated from local fast tests.

No external blockers were encountered. Focused integrations, the non-Nix integration runner, full Go checks, the integration Nix target, and every flake target passed before the amendment.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 25s 12s 12s 37s 25s
Eval 45s 1m48s 1m48s 2m34s 7s
Build 2m20s 5m28s 2m51s 5m12s 21s
Suite 25s 7m29s 4m46s 5m12s 54s

Timeline

0s1m1m20s1m40s2m2m20s3m3m20s3m40s4m4m20s4m40s5m