storetest

package
v0.10.0-alpha.26 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package storetest provides reusable conformance suites for background-task persistence providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNotificationOutboxConformance

func RunNotificationOutboxConformance(t *testing.T, config NotificationOutboxConfig)

RunNotificationOutboxConformance checks lease exclusion, expiry, redelivery, stale-receipt rejection, and acknowledgement.

func RunNotificationWriterConformance

func RunNotificationWriterConformance(t *testing.T, config NotificationWriterConfig)

RunNotificationWriterConformance checks authorization-before-replay, idempotency, bounds, identity, state preservation, and copy ownership.

func RunTaskEventStoreConformance

func RunTaskEventStoreConformance(t *testing.T, config TaskEventStoreConfig)

RunTaskEventStoreConformance validates append ordering, cursor validation, and snapshot-stable pagination.

func RunTaskStoreConformance

func RunTaskStoreConformance(t *testing.T, config TaskStoreConfig)

RunTaskStoreConformance checks lifecycle transitions, CAS, cancellation, pagination, ownership, and lease-expiry recovery.

Types

type NotificationOutboxConfig

type NotificationOutboxConfig struct {
	New         func(testing.TB) (backgroundtask.TaskStore, backgroundtask.NotificationOutbox)
	ExpireLease func(testing.TB, backgroundtask.NotificationOutbox, time.Duration)
}

NotificationOutboxConfig configures NotificationOutbox conformance. New returns lifecycle and outbox capabilities sharing one task namespace. ExpireLease must wait for or advance the provider past the requested lease.

type NotificationWriterConfig

type NotificationWriterConfig struct {
	New func(testing.TB) (
		backgroundtask.TaskStore,
		backgroundtask.NotificationOutbox,
	)
	ExpireActiveAttempt func(
		testing.TB,
		backgroundtask.TaskStore,
		*backgroundtask.Task,
	)
}

NotificationWriterConfig configures NotificationWriter conformance. New returns lifecycle and outbox capabilities sharing one task namespace; the returned TaskStore must also implement backgroundtask.NotificationWriter.

type TaskEventStoreConfig

type TaskEventStoreConfig struct {
	New func(testing.TB) (backgroundtask.TaskStore, backgroundtask.TaskEventStore)
}

TaskEventStoreConfig configures TaskEventStore conformance. New returns lifecycle and event capabilities sharing one task namespace.

type TaskStoreConfig

type TaskStoreConfig struct {
	New                 func(testing.TB) backgroundtask.TaskStore
	ExpireActiveAttempt func(testing.TB, backgroundtask.TaskStore, *backgroundtask.Task)
}

TaskStoreConfig configures TaskStore conformance. New returns an isolated provider for each subtest. ExpireActiveAttempt must wait for or advance the provider until the supplied running attempt's lease has expired.

Jump to

Keyboard shortcuts

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