conformancetest

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

func Run(t *testing.T, factory Factory)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL