testutil

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileDAGRepository added in v2.14.0

func NewFileDAGRepository(baseDir string, options ...filedag.Option) *persis.DAGRepository

NewFileDAGRepository constructs a file-backed DAG repository for tests.

func NewFileDAGRunRepository added in v2.14.0

func NewFileDAGRunRepository(
	baseDir string,
	options persis.DAGRunRepositoryOptions,
	storeOptions ...filedagrun.StoreOption,
) *persis.DAGRunRepository

NewFileDAGRunRepository constructs a file-backed repository for tests.

func StartContextRunner

func StartContextRunner(t *testing.T, runner ContextRunner) func()

StartContextRunner starts a context-driven runner and returns a shutdown function that cancels the context and waits for the runner to exit.

Types

type ContextRunner

type ContextRunner interface {
	Run(context.Context)
}

ContextRunner is a minimal interface for background services that are driven by a cancellable context.

type DAGRunStoreStub added in v2.14.0

type DAGRunStoreStub struct{}

DAGRunStoreStub fails when a test calls a store method it did not override.

func (DAGRunStoreStub) CompareAndSwapLatestAttemptStatus added in v2.14.0

func (DAGRunStoreStub) CompareAndSwapLatestAttemptStatus(
	context.Context,
	persis.DAGRunCompareAndSwapStatusRequest,
) (*ir.DAGRunStatus, bool, error)

func (DAGRunStoreStub) CreateAttempt added in v2.14.0

func (DAGRunStoreStub) FindAttempt added in v2.14.0

func (DAGRunStoreStub) FindSubAttempt added in v2.14.0

func (DAGRunStoreStub) LatestAttempt added in v2.14.0

func (DAGRunStoreStub) OpenLog added in v2.17.0

func (DAGRunStoreStub) QueryStatuses added in v2.14.0

func (DAGRunStoreStub) RecentStatuses added in v2.14.0

func (DAGRunStoreStub) RecentStatuses(context.Context, string, int) ([]ir.DAGRunStatus, error)

func (DAGRunStoreStub) RemoveDAGRun added in v2.14.0

func (DAGRunStoreStub) RemoveOldDAGRuns added in v2.14.0

type MockAttempt added in v2.14.0

type MockAttempt struct {
	mock.Mock
	Status *ir.DAGRunStatus
}

MockAttempt is a configurable DAG-run attempt for tests.

func (*MockAttempt) Abort added in v2.14.0

func (m *MockAttempt) Abort(ctx context.Context) error

func (*MockAttempt) Close added in v2.14.0

func (m *MockAttempt) Close(ctx context.Context) error

func (*MockAttempt) Hidden added in v2.14.0

func (m *MockAttempt) Hidden() bool

func (*MockAttempt) Hide added in v2.14.0

func (m *MockAttempt) Hide(ctx context.Context) error

func (*MockAttempt) ID added in v2.14.0

func (m *MockAttempt) ID() string

func (*MockAttempt) IsAborting added in v2.14.0

func (m *MockAttempt) IsAborting(ctx context.Context) (bool, error)

func (*MockAttempt) Open added in v2.14.0

func (m *MockAttempt) Open(ctx context.Context) error

func (*MockAttempt) ReadDAG added in v2.14.0

func (m *MockAttempt) ReadDAG(ctx context.Context) (*ir.DAG, error)

func (*MockAttempt) ReadOutputs added in v2.14.0

func (m *MockAttempt) ReadOutputs(ctx context.Context) (*ir.DAGRunOutputs, error)

func (*MockAttempt) ReadStatus added in v2.14.0

func (m *MockAttempt) ReadStatus(ctx context.Context) (*ir.DAGRunStatus, error)

func (*MockAttempt) ReadStatusUncached added in v2.15.3

func (m *MockAttempt) ReadStatusUncached(ctx context.Context) (*ir.DAGRunStatus, error)

func (*MockAttempt) ReadStepMessages added in v2.14.0

func (m *MockAttempt) ReadStepMessages(ctx context.Context, stepName string) ([]ir.LLMMessage, error)

func (*MockAttempt) SetDAG added in v2.14.0

func (m *MockAttempt) SetDAG(dag *ir.DAG)

func (*MockAttempt) Write added in v2.14.0

func (m *MockAttempt) Write(ctx context.Context, status ir.DAGRunStatus) error

func (*MockAttempt) WriteOutputs added in v2.14.0

func (m *MockAttempt) WriteOutputs(ctx context.Context, outputs *ir.DAGRunOutputs) error

func (*MockAttempt) WriteStepMessages added in v2.14.0

func (m *MockAttempt) WriteStepMessages(ctx context.Context, stepName string, messages []ir.LLMMessage) error

type MockQueueStore added in v2.13.0

type MockQueueStore struct {
	mock.Mock
}

MockQueueStore is a configurable queue store for tests.

func (*MockQueueStore) All added in v2.13.0

func (*MockQueueStore) DeleteByItemIDs added in v2.13.0

func (m *MockQueueStore) DeleteByItemIDs(ctx context.Context, name string, itemIDs []string) (int, error)

func (*MockQueueStore) DequeueByDAGRunID added in v2.13.0

func (m *MockQueueStore) DequeueByDAGRunID(ctx context.Context, name string, run ir.DAGRunRef) ([]queue.QueuedItemData, error)

func (*MockQueueStore) Enqueue added in v2.13.0

func (m *MockQueueStore) Enqueue(ctx context.Context, name string, priority queue.QueuePriority, run ir.DAGRunRef) error

func (*MockQueueStore) GetByItemID added in v2.15.3

func (m *MockQueueStore) GetByItemID(ctx context.Context, name, itemID string) (queue.QueuedItemData, error)

func (*MockQueueStore) Len added in v2.13.0

func (m *MockQueueStore) Len(ctx context.Context, name string) (int, error)

func (*MockQueueStore) List added in v2.13.0

func (m *MockQueueStore) List(ctx context.Context, name string) ([]queue.QueuedItemData, error)

func (*MockQueueStore) ListByDAGName added in v2.13.0

func (m *MockQueueStore) ListByDAGName(ctx context.Context, name, dagName string) ([]queue.QueuedItemData, error)

func (*MockQueueStore) ListCursor added in v2.13.0

func (m *MockQueueStore) ListCursor(ctx context.Context, name, cursor string, limit int) (pagination.CursorResult[queue.QueuedItemData], error)

func (*MockQueueStore) QueueList added in v2.13.0

func (m *MockQueueStore) QueueList(ctx context.Context) ([]string, error)

func (*MockQueueStore) QueueWatcher added in v2.13.0

func (m *MockQueueStore) QueueWatcher(ctx context.Context) queue.QueueWatcher

func (*MockQueueStore) Revision added in v2.15.3

func (m *MockQueueStore) Revision(ctx context.Context, name string) (int64, error)

Jump to

Keyboard shortcuts

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