Documentation
¶
Overview ¶
Package conformancetest exposes the canonical correctness suite every artifacts.ArtifactStore driver must pass.
The suite lives in a subpackage so the production-code path `internal/artifacts` does not import the standard library `testing` package (precedent: `internal/state/conformancetest`).
Downstream drivers (SQLite-blob + Postgres-blob, the S3-style) consume it via:
import "github.com/hurtener/Harbor/internal/artifacts/conformancetest"
func TestMyDriver_Conformance(t *testing.T) {
conformancetest.Run(t, func() (artifacts.ArtifactStore, func()) {
s := mydriver.MustNew(t)
return s, func() { _ = s.Close(context.Background()) }
})
}
The factory must return a fresh, empty ArtifactStore plus a cleanup callback. The suite uses the factory once per top-level subtest; invocations are independent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes the canonical correctness suite. Subtests:
- Put_Get_RoundTrip
- Put_DedupOnIdenticalBytes
- Put_DistinguishesByNamespace
- Put_DistinguishesByScope
- PutText_StoredAsBytes
- Get_NotFound
- GetRef_NotFound
- Delete_Idempotent
- List_FiltersByScope
- List_NilFieldsAreWildcards
- Put_Identity_Mandatory
- Get_CrossTenant_Isolation
- Delete_CrossTenant_Isolation
- Put_AfterClose_Errors
- Concurrent_PutGet_NoRace
- Close_Idempotent
- GoroutineLeak_AfterClose
- Scoped_AutoStamps_Scope
- Scoped_PanicsOnInvalidScope
- Scoped_ImmutableScope
Types ¶
type Factory ¶
type Factory func() (artifacts.ArtifactStore, func())
Factory builds a fresh ArtifactStore and returns a cleanup closure.