Documentation
¶
Overview ¶
Package blobtest is test support for the blob.Store seam: it starts one Dockerized Silo (a MinIO fork, see Image) per test binary and hands out per-test targets (endpoint, credentials, fresh bucket name) for backends to construct stores against. Production code must never import it. A missing Docker daemon is a hard failure, not a skip: skipped contract tests would silently hollow out the coverage gate (the pgtest rule).
Index ¶
Constants ¶
const ( RootUser = "blobtest" RootPassword = "blobtest-secret" )
Root credentials for the throwaway container (the server requires a password of at least 8 characters).
const Image = "pgsty/silo:RELEASE.2026-09-16T00-00-00Z@sha256:635197cb9f36d01bee221d34d1c7d7960f6a95c48b0b6c01d99cd13bdae51a46"
Image is the pinned object store the harness runs — the same image deploy/compose and the helm chart default to, so the contract tests exercise what ships; pins_test.go fails when one of the three moves without the others.
It is PGSTY Silo, a maintained fork of the MinIO server, not MinIO itself, and every one of those three pins changed for the same reason: MinIO took its community images off both registries it had published them to. Docker Hub stopped serving the `minio` namespace between 2026-09-11 and 2026-09-12 (#701), and quay.io, which the pins moved to then, began refusing `minio/minio` with a 401 on 2026-09-24 (#799) — each time a hard failure on any machine without the image already cached. Silo keeps the server's wire and operator surface, which is what the three pins depend on: the S3 API, the MINIO_ROOT_* variables, the /minio/health/* routes, `server /data` as the container's arguments, and `mc` in the image. The digest pins the bytes as well as the release: the image comes from one third-party publisher, and a re-pushed tag would otherwise change the server every fresh machine pulls, unnoticed.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main wraps testing.M: it starts the shared Silo container, runs the suite, and tears the container down. Use from TestMain: os.Exit(blobtest.Main(m)). The start is attempted twice, with a fresh container in between (#265; the retry's rationale is on pgtest.Main, whose rule this follows). It opens by reaping what an earlier killed run left behind, the defer below being unreachable to one (#346; the rationale is in dockertest).
func Run ¶
Run exercises the blob.Store contract (CLAUDE.md: every backend passes the same shared suite). newStore is called once per subtest so a backend can isolate its own fixtures — for the S3 backend, a fresh bucket per subtest. The suite asserts observable behavior only, never a backend's internals.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is Mem's implementation. The concrete type is exported so tests can reach behind the API under test (Len, direct Delete) to assert storage side effects.
func Mem ¶
func Mem() *MemStore
Mem returns an in-memory blob.Store for tests exercising logic above the storage seam (the API registry, later the executor's materialization). It holds the same contract as the real backends — the suite in contract.go runs against it in mem_test.go — without a Silo container, so suites that already carry a Postgres harness need no second one.
type Target ¶
type Target struct {
Endpoint string // host:port, plain HTTP
AccessKey string
SecretKey string
Bucket string
}
Target is one test's connection coordinates: the shared container's endpoint and credentials plus a bucket name no other test uses. The backend under test is expected to create the bucket itself.
func FreshTarget ¶
FreshTarget returns the shared container's coordinates with a bucket name unique to this call.