Spectre.Definition.Store.Conformance (Spectre v0.3.0)

Copy Markdown View Source

Adapter-neutral Definition Store conformance checks.

Store implementations can call this module from their own test suites. It checks immutable publication, duplicate idempotency, verified read-back, and optional read-after-restart using only the public Store boundary and without depending on ExUnit in production code.

Summary

Functions

Verifies that a durable adapter configuration still resolves the same artifact after its process or connection has been recreated.

Runs the common publication and read-back contract.

Types

report()

@type report() :: %{
  definition_ref: String.t(),
  publication_id: String.t(),
  initial_state: :not_found | :existing,
  duplicate: :idempotent,
  readback: :verified
}

Functions

read_after_restart(before, after_restart, ref, opts \\ [])

@spec read_after_restart(
  Spectre.Definition.Store.config(),
  Spectre.Definition.Store.config(),
  String.t(),
  keyword()
) :: :ok | {:error, term()}

Verifies that a durable adapter configuration still resolves the same artifact after its process or connection has been recreated.

run(store, canonical, manifest, opts \\ [])

Runs the common publication and read-back contract.