No integration test of the end-to-end image proxy flow #80
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Verified against
mainat61f42e6. This is the "integration tests for the image proxy flow" item inTODO.md; confirmed genuinely missing.Every existing test stops short of the full path.
internal/imgcache/service_test.gouseshttpfetcher.MockFetcherreading fixtures from disk, so nothing exercises: router to handler to fetcher to libvips to disk to database, and then a second request served as a HIT.The consequence is that wiring bugs are invisible to CI. Every component can pass its unit tests while the fx graph wires them together wrongly, the cache key differs between write and read (so nothing ever hits), or the eviction goroutine never starts. The manual pass recorded in
TODO.mdis currently the only evidence the whole thing works, and it is not repeatable in CI.Definition of done
httptest.Server), then:X-Pixa-Cacheheader and on the upstream server receiving exactly one request, not on timing;origpassthrough.make testwithin the existing 30 s timeout. If real libvips work makes that tight, use small fixtures rather than raising the timeout; if a build tag is needed to keep the default suite fast, wire it intoscript/testso CI still runs it — an integration test excluded from CI is not one.make checkgreen.Coordination
Best written after #55 merges, so it also covers the eviction wiring (
StartEvictiononOnStart,StopEvictiononOnStop) rather than needing rework immediately. It would also have independently caught the accounting-vs-disk drift that #55's reconciliation exists to repair.