TestImageProxyFlow in internal/server starts the database, handlers and middleware from the constructors pixad uses, with a fresh state directory, and replaces only the upstream origin with an httptest server. For a resize with a format change and for orig it checks a 200 MISS with the right type and size, then a HIT after one upstream request, and the files and rows the cache keeps. Two optional test seams make that possible: httpfetcher.Config.DialContext and handlers.Params.Fetcher. pixad sets neither and the config file and environment cannot, and tests show production still uses the checked dialer and builds its own fetcher. Model: opus-5-5
This commit was merged in pull request #195.
This commit is contained in:
@@ -42,7 +42,8 @@ type Service struct {
|
||||
type ServiceConfig struct {
|
||||
// Cache is the cache instance
|
||||
Cache *Cache
|
||||
// FetcherConfig configures the upstream fetcher (ignored if Fetcher is set)
|
||||
// FetcherConfig configures the upstream fetcher built when Fetcher is
|
||||
// not set. Its AllowHTTP and MaxResponseSize are used either way.
|
||||
FetcherConfig *httpfetcher.Config
|
||||
// Fetcher is an optional custom fetcher (for testing)
|
||||
Fetcher httpfetcher.Fetcher
|
||||
|
||||
Reference in New Issue
Block a user