workflowtest

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New creates a Temporal test environment (go.temporal.io/sdk/ testsuite) set up as the service's worker is: every activity declared with activity.Handle (by name, over the envelope), every workflow of workflows.Declare and workflows.Activity, and what workflows.Register registers. The service's hooks are a Nexus service of the environment answered by Answer, so workflows.CallHook works in workflow code; an unanswered hook fails with hook.ErrNoBinding, a failing answer with its message. Declare everything first; Start the harness first when the handlers use dependencies. An environment runs one workflow: call New again for the next.

w := workflowtest.New(t, h)
w.ExecuteWorkflow("Welcome", in)
err := w.GetWorkflowResult(&out)

func WorkflowActivity

func WorkflowActivity[Req, Res any](w *testsuite.TestWorkflowEnvironment, name string, in Req) (Res, error)

WorkflowActivity runs the workflow-backed activity name (workflows.Activity) in w as a binding step would start it, and returns its result. w is from New; it runs this one workflow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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