Documentation
¶
Index ¶
- type StorageContractSuite
- func (s *StorageContractSuite) SetContext(ctx context.Context)
- func (s *StorageContractSuite) SetLogger(log *testutil.TestLogger)
- func (s *StorageContractSuite) SetStorage(store storage.Storage)
- 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_SpeculationCreateAndGet()
- func (s *StorageContractSuite) TestStorage_SpeculationCreateDuplicate()
- func (s *StorageContractSuite) TestStorage_SpeculationGetNotFound()
- func (s *StorageContractSuite) TestStorage_SpeculationPathBuildCreateAndGet()
- func (s *StorageContractSuite) TestStorage_SpeculationPathBuildCreateDuplicate()
- func (s *StorageContractSuite) TestStorage_SpeculationPathBuildGetNotFound()
- func (s *StorageContractSuite) TestStorage_SpeculationUpdate()
- func (s *StorageContractSuite) TestStorage_SpeculationUpdateNotFound()
- func (s *StorageContractSuite) TestStorage_UpdateState()
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.Storage interface. All storage implementations must pass these tests. Implementation-specific tests should embed this suite and call SetStorage().
func (*StorageContractSuite) SetContext ¶
func (s *StorageContractSuite) SetContext(ctx context.Context)
SetContext sets the context for tests
func (*StorageContractSuite) SetLogger ¶
func (s *StorageContractSuite) SetLogger(log *testutil.TestLogger)
SetLogger sets the logger for tests
func (*StorageContractSuite) SetStorage ¶
func (s *StorageContractSuite) SetStorage(store storage.Storage)
SetStorage is called by implementation tests to provide the concrete storage instance
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 (assigned by the build runner, not derived from the path), SpeculationPathID links the build back to the speculation-tree path it verifies, and Get by ID finds the build with both round-tripped 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_SpeculationCreateAndGet ¶
func (s *StorageContractSuite) TestStorage_SpeculationCreateAndGet()
TestStorage_SpeculationCreateAndGet verifies a tree round-trips through the store preserving every path field (Base/Head, Score, Status, BuildID).
func (*StorageContractSuite) TestStorage_SpeculationCreateDuplicate ¶
func (s *StorageContractSuite) TestStorage_SpeculationCreateDuplicate()
TestStorage_SpeculationCreateDuplicate verifies a repeated Create for the same batch returns ErrAlreadyExists.
func (*StorageContractSuite) TestStorage_SpeculationGetNotFound ¶
func (s *StorageContractSuite) TestStorage_SpeculationGetNotFound()
TestStorage_SpeculationGetNotFound verifies Get for an unknown batch returns ErrNotFound.
func (*StorageContractSuite) TestStorage_SpeculationPathBuildCreateAndGet ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathBuildCreateAndGet()
TestStorage_SpeculationPathBuildCreateAndGet verifies a path->build mapping round-trips through the store unchanged.
func (*StorageContractSuite) TestStorage_SpeculationPathBuildCreateDuplicate ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathBuildCreateDuplicate()
TestStorage_SpeculationPathBuildCreateDuplicate verifies a repeated Create for the same PathID returns ErrAlreadyExists — a path maps to at most one build, and the first-written mapping wins.
func (*StorageContractSuite) TestStorage_SpeculationPathBuildGetNotFound ¶
func (s *StorageContractSuite) TestStorage_SpeculationPathBuildGetNotFound()
TestStorage_SpeculationPathBuildGetNotFound verifies Get for an unknown path ID returns ErrNotFound.
func (*StorageContractSuite) TestStorage_SpeculationUpdate ¶
func (s *StorageContractSuite) TestStorage_SpeculationUpdate()
TestStorage_SpeculationUpdate verifies Update overwrites the entire set of paths for a batch (the controller persists the whole tree each respeculate) under the version guard, and that a stale version is rejected with ErrVersionMismatch without modifying the stored tree.
func (*StorageContractSuite) TestStorage_SpeculationUpdateNotFound ¶
func (s *StorageContractSuite) TestStorage_SpeculationUpdateNotFound()
TestStorage_SpeculationUpdateNotFound verifies Update for an unknown batch returns ErrVersionMismatch — the conditional write matches no row, and the store cannot distinguish a missing tree from a stale version.
func (*StorageContractSuite) TestStorage_UpdateState ¶
func (s *StorageContractSuite) TestStorage_UpdateState()
TestStorage_UpdateState tests updating request state