Documentation
¶
Overview ¶
Package storetest provides reusable conformance suites for background-task persistence providers.
Index ¶
- func RunNotificationOutboxConformance(t *testing.T, config NotificationOutboxConfig)
- func RunNotificationWriterConformance(t *testing.T, config NotificationWriterConfig)
- func RunTaskEventStoreConformance(t *testing.T, config TaskEventStoreConfig)
- func RunTaskStoreConformance(t *testing.T, config TaskStoreConfig)
- type NotificationOutboxConfig
- type NotificationWriterConfig
- type TaskEventStoreConfig
- type TaskStoreConfig
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.