Documentation
¶
Index ¶
- type StorageContractSuite
- func (s *StorageContractSuite) SetContext(ctx context.Context)
- func (s *StorageContractSuite) SetFactory(factory storage.Factory)
- func (s *StorageContractSuite) SetLogger(log *testutil.TestLogger)
- func (s *StorageContractSuite) TestStorage_BatchDependentUpdate()
- func (s *StorageContractSuite) TestStorage_BatchUpdateReplacesAllNonKeyFields()
- func (s *StorageContractSuite) TestStorage_BuildCreateAndGet()
- func (s *StorageContractSuite) TestStorage_ChangeCreateAndGet_Match()
- func (s *StorageContractSuite) TestStorage_ChangeCreateAndGet_NoMatch()
- func (s *StorageContractSuite) TestStorage_ChangeCreate_DifferentRequestSameURI()
- func (s *StorageContractSuite) TestStorage_ChangeCreate_EmptyDetails()
- func (s *StorageContractSuite) TestStorage_ChangeCreate_Idempotent()
- func (s *StorageContractSuite) TestStorage_ChangeCreate_PreservesDetails()
- func (s *StorageContractSuite) TestStorage_ChangeGetByURI_DoesNotExcludeSelf()
- func (s *StorageContractSuite) TestStorage_ChangeGetByURI_QueueScoped()
- func (s *StorageContractSuite) TestStorage_CreateAndGet()
- func (s *StorageContractSuite) TestStorage_CreateAndGet_StackedPRs()
- func (s *StorageContractSuite) TestStorage_CreateDuplicate()
- func (s *StorageContractSuite) TestStorage_NotFound()
- func (s *StorageContractSuite) TestStorage_OptimisticLocking()
- func (s *StorageContractSuite) TestStorage_PathBuildIsImmutable()
- func (s *StorageContractSuite) TestStorage_PathBuildResolvesAnAttemptToItsBuild()
- func (s *StorageContractSuite) TestStorage_QueueBatchStateRecordLifecycle()
- func (s *StorageContractSuite) TestStorage_QueueIsolation()
- func (s *StorageContractSuite) TestStorage_RequestLogAppendAndList()
- func (s *StorageContractSuite) TestStorage_RequestQueueSummaryListAndCursor()
- func (s *StorageContractSuite) TestStorage_RequestSummaryCreateGetAndCAS()
- func (s *StorageContractSuite) TestStorage_RequestURIListIsBoundedAndOrdered()
- func (s *StorageContractSuite) TestStorage_SpeculationPathSetCreateAndGet()
- func (s *StorageContractSuite) TestStorage_SpeculationPathSetCreateDuplicate()
- func (s *StorageContractSuite) TestStorage_SpeculationPathSetNotFound()
- func (s *StorageContractSuite) TestStorage_SpeculationPathSetOptimisticLocking()
- func (s *StorageContractSuite) TestStorage_SpeculationPathSetQueueIsolation()
- func (s *StorageContractSuite) TestStorage_Update()
- func (s *StorageContractSuite) TestStorage_UpdateChangeURIs()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorageContractSuite ¶
StorageContractSuite defines the contract tests for the storage extension: the queue-scoped aggregate resolved through storage.Factory. All storage implementations must pass these tests. Implementation-specific tests should embed this suite and call SetFactory().
func (*StorageContractSuite) SetContext ¶
func (s *StorageContractSuite) SetContext(ctx context.Context)
SetContext sets the context for tests
func (*StorageContractSuite) SetFactory ¶
func (s *StorageContractSuite) SetFactory(factory storage.Factory)
SetFactory is called by implementation tests to provide the queue-scoped storage factory under test.
func (*StorageContractSuite) SetLogger ¶
func (s *StorageContractSuite) SetLogger(log *testutil.TestLogger)
SetLogger sets the logger for tests
func (*StorageContractSuite) TestStorage_BatchDependentUpdate ¶
func (s *StorageContractSuite) TestStorage_BatchDependentUpdate()
TestStorage_BatchDependentUpdate verifies full updates, collection encoding, and optimistic locking.
func (*StorageContractSuite) TestStorage_BatchUpdateReplacesAllNonKeyFields ¶
func (s *StorageContractSuite) TestStorage_BatchUpdateReplacesAllNonKeyFields()
func (*StorageContractSuite) TestStorage_BuildCreateAndGet ¶
func (s *StorageContractSuite) TestStorage_BuildCreateAndGet()
TestStorage_BuildCreateAndGet verifies a build round-trips through the store: ID is the runner-minted build identifier, and Get by ID finds the build with every field intact.
func (*StorageContractSuite) TestStorage_ChangeCreateAndGet_Match ¶
func (s *StorageContractSuite) TestStorage_ChangeCreateAndGet_Match()
TestStorage_ChangeCreateAndGet_Match verifies a created record is returned by GetByURI.
func (*StorageContractSuite) TestStorage_ChangeCreateAndGet_NoMatch ¶
func (s *StorageContractSuite) TestStorage_ChangeCreateAndGet_NoMatch()
TestStorage_ChangeCreateAndGet_NoMatch verifies GetByURI returns empty for an unclaimed URI.
func (*StorageContractSuite) TestStorage_ChangeCreate_DifferentRequestSameURI ¶
func (s *StorageContractSuite) TestStorage_ChangeCreate_DifferentRequestSameURI()
TestStorage_ChangeCreate_DifferentRequestSameURI verifies distinct requests on one URI coexist.
func (*StorageContractSuite) TestStorage_ChangeCreate_EmptyDetails ¶
func (s *StorageContractSuite) TestStorage_ChangeCreate_EmptyDetails()
TestStorage_ChangeCreate_EmptyDetails verifies a zero-value Details round-trips (stored as a JSON object).
func (*StorageContractSuite) TestStorage_ChangeCreate_Idempotent ¶
func (s *StorageContractSuite) TestStorage_ChangeCreate_Idempotent()
TestStorage_ChangeCreate_Idempotent verifies a repeated Create of the same PK is a no-op.
func (*StorageContractSuite) TestStorage_ChangeCreate_PreservesDetails ¶
func (s *StorageContractSuite) TestStorage_ChangeCreate_PreservesDetails()
TestStorage_ChangeCreate_PreservesDetails verifies typed Details round-trip through the store.
func (*StorageContractSuite) TestStorage_ChangeGetByURI_DoesNotExcludeSelf ¶
func (s *StorageContractSuite) TestStorage_ChangeGetByURI_DoesNotExcludeSelf()
TestStorage_ChangeGetByURI_DoesNotExcludeSelf verifies the store does not filter by request_id.
func (*StorageContractSuite) TestStorage_ChangeGetByURI_QueueScoped ¶
func (s *StorageContractSuite) TestStorage_ChangeGetByURI_QueueScoped()
TestStorage_ChangeGetByURI_QueueScoped verifies GetByURI never returns rows from another queue.
func (*StorageContractSuite) TestStorage_CreateAndGet ¶
func (s *StorageContractSuite) TestStorage_CreateAndGet()
TestStorage_CreateAndGet tests creating and retrieving a request
func (*StorageContractSuite) TestStorage_CreateAndGet_StackedPRs ¶
func (s *StorageContractSuite) TestStorage_CreateAndGet_StackedPRs()
TestStorage_CreateAndGet_StackedPRs tests creating and retrieving a request with stacked PRs
func (*StorageContractSuite) TestStorage_CreateDuplicate ¶
func (s *StorageContractSuite) TestStorage_CreateDuplicate()
TestStorage_CreateDuplicate tests creating a request with duplicate ID
func (*StorageContractSuite) TestStorage_NotFound ¶
func (s *StorageContractSuite) TestStorage_NotFound()
TestStorage_NotFound tests getting a non-existent request
func (*StorageContractSuite) TestStorage_OptimisticLocking ¶
func (s *StorageContractSuite) TestStorage_OptimisticLocking()
TestStorage_OptimisticLocking tests version-based optimistic locking
func (*StorageContractSuite) TestStorage_PathBuildIsImmutable ¶
func (s *StorageContractSuite) TestStorage_PathBuildIsImmutable()
TestStorage_PathBuildIsImmutable tests that an attempt keeps the build it was first linked to. A redelivered dispatch must be refused rather than silently repointing the attempt at a second build, which would orphan the first.
func (*StorageContractSuite) TestStorage_PathBuildResolvesAnAttemptToItsBuild ¶
func (s *StorageContractSuite) TestStorage_PathBuildResolvesAnAttemptToItsBuild()
TestStorage_PathBuildResolvesAnAttemptToItsBuild tests the reverse lookup the speculate run depends on: it holds a path and an attempt, and the runner chose the build ID, so this record is the only way back.
func (*StorageContractSuite) TestStorage_QueueBatchStateRecordLifecycle ¶
func (s *StorageContractSuite) TestStorage_QueueBatchStateRecordLifecycle()
TestStorage_QueueBatchStateRecordLifecycle exercises the QueueBatchStateStore contract: Put idempotency, List isolation between (queue, state) buckets, the Put-then-Delete record move, and Delete idempotency.
func (*StorageContractSuite) TestStorage_QueueIsolation ¶
func (s *StorageContractSuite) TestStorage_QueueIsolation()
TestStorage_QueueIsolation verifies a store aggregate bound to one queue can neither read nor write another queue's records: cross-queue reads miss, and writes whose entity queue disagrees with the binding are rejected.
func (*StorageContractSuite) TestStorage_RequestLogAppendAndList ¶
func (s *StorageContractSuite) TestStorage_RequestLogAppendAndList()
TestStorage_RequestLogAppendAndList tests the append-only audit trail and its queue scoping: a request ID is unique only within its queue, so the same ID in two queues is two independent histories.
func (*StorageContractSuite) TestStorage_RequestQueueSummaryListAndCursor ¶
func (s *StorageContractSuite) TestStorage_RequestQueueSummaryListAndCursor()
func (*StorageContractSuite) TestStorage_RequestSummaryCreateGetAndCAS ¶
func (s *StorageContractSuite) TestStorage_RequestSummaryCreateGetAndCAS()
func (*StorageContractSuite) TestStorage_RequestURIListIsBoundedAndOrdered ¶
func (s *StorageContractSuite) TestStorage_RequestURIListIsBoundedAndOrdered()
func (*StorageContractSuite) TestStorage_SpeculationPathSetCreateAndGet ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathSetCreateAndGet()
TestStorage_SpeculationPathSetCreateAndGet tests that a set round-trips whole, including each path's assumptions — a path's identity hashes them, so an encoding that dropped or reordered them would silently change every path ID.
func (*StorageContractSuite) TestStorage_SpeculationPathSetCreateDuplicate ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathSetCreateDuplicate()
TestStorage_SpeculationPathSetCreateDuplicate tests that a head gets at most one set.
func (*StorageContractSuite) TestStorage_SpeculationPathSetNotFound ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathSetNotFound()
TestStorage_SpeculationPathSetNotFound tests reading a head nothing has speculated on yet — the normal state for a freshly created batch.
func (*StorageContractSuite) TestStorage_SpeculationPathSetOptimisticLocking ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathSetOptimisticLocking()
TestStorage_SpeculationPathSetOptimisticLocking tests the compare-and-swap contract. Speculate, build, and buildsignal all write the same row, so a loser must be rejected outright rather than clobbering the winner's paths.
func (*StorageContractSuite) TestStorage_SpeculationPathSetQueueIsolation ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathSetQueueIsolation()
TestStorage_SpeculationPathSetQueueIsolation tests that the same head in two queues is two independent sets: a batch ID is only unique within its queue, so one queue's binding must never surface or overwrite another's row.
func (*StorageContractSuite) TestStorage_Update ¶
func (s *StorageContractSuite) TestStorage_Update()
TestStorage_Update tests replacing all non-key request fields.
func (*StorageContractSuite) TestStorage_UpdateChangeURIs ¶
func (s *StorageContractSuite) TestStorage_UpdateChangeURIs()
TestStorage_UpdateChangeURIs tests nil and empty URI replacement semantics.