workflow

package
v1.18.5-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithAddActivity added in v1.16.0

func WithAddActivity(t *testing.T, name string, a func(task.ActivityContext) (any, error)) Option

func WithAddActivityN

func WithAddActivityN(t *testing.T, index int, name string, a func(task.ActivityContext) (any, error)) Option

func WithAddOrchestrator added in v1.16.0

func WithAddOrchestrator(t *testing.T, name string, or func(*task.WorkflowContext) (any, error)) Option

func WithAddWorkflowN added in v1.18.0

func WithAddWorkflowN(t *testing.T, index int, name string, or func(*task.WorkflowContext) (any, error)) Option

func WithDaprdOptions added in v1.16.0

func WithDaprdOptions(index int, opts ...daprd.Option) Option

func WithDaprds added in v1.15.6

func WithDaprds(daprds int) Option

func WithHistorySigning added in v1.18.4

func WithHistorySigning(t *testing.T) Option

WithHistorySigning enables the WorkflowHistorySigning feature flag on every daprd in the workflow. History signing needs the Sentry-issued workload identity for its attestation and signing keys, so this also enables the mTLS setup of WithMTLS. Prefer this over WithMTLS in tests that are about signing behavior, so the intent is explicit at the call site.

func WithMTLS added in v1.18.0

func WithMTLS(t *testing.T) Option

WithMTLS spins up a Sentry process for mTLS and enables the WorkflowHistorySigning feature flag on every daprd in the workflow.

func WithNoDB added in v1.17.0

func WithNoDB() Option

func WithPlacementOptions added in v1.18.0

func WithPlacementOptions(opts ...placement.Option) Option

func WithSchedulerAddress added in v1.17.7

func WithSchedulerAddress(addr string) Option

WithSchedulerAddress overrides the address used for the daprd's --scheduler-host-address flag. Use this to point daprd at a proxy that fronts the real scheduler.

func WithSchedulerInstance added in v1.17.7

func WithSchedulerInstance(sched *scheduler.Scheduler) Option

WithSchedulerInstance lets a test supply a pre-constructed scheduler. The framework uses this scheduler instead of creating its own and skips adding it to its process list (the caller is responsible for that). Combine with WithSchedulerAddress when interposing a proxy.

func WithSchedulerOptions added in v1.18.0

func WithSchedulerOptions(opts ...scheduler.Option) Option

func WithSigningDisabledN added in v1.18.0

func WithSigningDisabledN(index int) Option

WithSigningDisabledN excludes the daprd at the given index from having the WorkflowHistorySigning feature flag set. Has no effect without WithMTLS or WithHistorySigning.

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, fopts ...Option) *Workflow

func NewClustered added in v1.17.13

func NewClustered(t *testing.T, daprds int, extraDaprdOpts ...daprd.Option) *Workflow

NewClustered returns a Workflow whose daprds share a single app ID with WorkflowsClusteredDeployment enabled, representing a clustered deployment behind a load balancer.

func (*Workflow) ActivityActorType added in v1.18.4

func (w *Workflow) ActivityActorType(index int) string

ActivityActorType returns the activity actor type registered by the daprd at the given index (default namespace).

func (*Workflow) BackendClient

func (w *Workflow) BackendClient(t *testing.T, ctx context.Context) *client.TaskHubGrpcClient

func (*Workflow) BackendClientN added in v1.16.0

func (w *Workflow) BackendClientN(t *testing.T, ctx context.Context, index int) *client.TaskHubGrpcClient

BackendClient returns a backend client for the specified index

func (*Workflow) Cleanup

func (w *Workflow) Cleanup(t *testing.T)

func (*Workflow) DB added in v1.15.0

func (w *Workflow) DB() *sqlite.SQLite

func (*Workflow) Dapr added in v1.15.0

func (w *Workflow) Dapr() *daprd.Daprd

func (*Workflow) DaprN added in v1.15.6

func (w *Workflow) DaprN(i int) *daprd.Daprd

func (*Workflow) GRPCClient

func (w *Workflow) GRPCClient(t *testing.T, ctx context.Context) rtv1.DaprClient

func (*Workflow) GRPCClientN added in v1.16.0

func (w *Workflow) GRPCClientN(t *testing.T, ctx context.Context, index int) rtv1.DaprClient

GRPCClientForApp returns a GRPC client for the specified app index

func (*Workflow) ManagementClient added in v1.18.3

func (w *Workflow) ManagementClient(t *testing.T, ctx context.Context) *client.TaskHubGrpcClient

ManagementClient returns a backend client connected to daprd index 0 for control-plane operations only. See ManagementClientN.

func (*Workflow) ManagementClientN added in v1.18.3

func (w *Workflow) ManagementClientN(t *testing.T, ctx context.Context, index int) *client.TaskHubGrpcClient

ManagementClientN returns a backend client connected to the daprd at the given index for control-plane operations only (scheduling, waiting, raising events, fetching history). It does not start a work-item listener, so it never executes workflows and never advertises any worker capability.

func (*Workflow) Metrics

func (w *Workflow) Metrics(t *testing.T, ctx context.Context) map[string]float64

func (*Workflow) Placement added in v1.18.0

func (w *Workflow) Placement() *placement.Placement

func (*Workflow) Registry added in v1.15.0

func (w *Workflow) Registry() *task.TaskRegistry

func (*Workflow) RegistryN added in v1.16.0

func (w *Workflow) RegistryN(index int) *task.TaskRegistry

Registry returns the registry for a specific index

func (*Workflow) ResetRegistry added in v1.17.0

func (w *Workflow) ResetRegistry(t *testing.T)

func (*Workflow) Run

func (w *Workflow) Run(t *testing.T, ctx context.Context)

func (*Workflow) Scheduler added in v1.17.0

func (w *Workflow) Scheduler() *scheduler.Scheduler

func (*Workflow) Sentry added in v1.18.0

func (w *Workflow) Sentry() *sentry.Sentry

func (*Workflow) StrayFire added in v1.18.4

func (w *Workflow) StrayFire(t *testing.T, ctx context.Context, index int, instanceID string, mtls bool)

StrayFire schedules a stray new-event reminder against the workflow actor hosted by daprd index, driving its empty-inbox path, and waits until the scheduler has delivered it.

func (*Workflow) WaitForNoConnectedWorkers added in v1.17.13

func (w *Workflow) WaitForNoConnectedWorkers(t *testing.T, ctx context.Context)

func (*Workflow) WaitForNoConnectedWorkersN added in v1.17.13

func (w *Workflow) WaitForNoConnectedWorkersN(t *testing.T, ctx context.Context, index int)

func (*Workflow) WaitUntilRunning

func (w *Workflow) WaitUntilRunning(t *testing.T, ctx context.Context)

func (*Workflow) WorkflowActorType added in v1.18.4

func (w *Workflow) WorkflowActorType(index int) string

WorkflowActorType returns the orchestrator actor type registered by the daprd at the given index (default namespace).

func (*Workflow) WorkflowClient added in v1.17.0

func (w *Workflow) WorkflowClient(t *testing.T, ctx context.Context) *workflow.Client

func (*Workflow) WorkflowClientN added in v1.17.0

func (w *Workflow) WorkflowClientN(t *testing.T, ctx context.Context, index int) *workflow.Client

func (*Workflow) WriteWorkflowState added in v1.18.4

func (w *Workflow) WriteWorkflowState(t *testing.T, ctx context.Context, index int, instanceID string, generation uint64, history, inbox []*protos.HistoryEvent)

WriteWorkflowState writes a fabricated durable workflow state for the given instance straight into the SQLite actor state store: the history and inbox event rows plus the metadata row describing them, in the exact key layout the workflow state loader reads. Existing history and inbox rows for the instance are deleted first so the metadata lengths stay authoritative. daprd in-memory caches are not touched; pair this with a scheduler-driven reminder or a fresh actor activation to make daprd observe the rows.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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