tasktest

package
v0.58.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTask

func RunTask[T any](baseContext context.Context, task coretask.Task[T], taskDependencyValues ...TaskDependencyValues) (T, error)

RunTask runs a single task.

func RunTaskWithDependency

func RunTaskWithDependency[T any](baseContext context.Context, mainTask coretask.Task[T], dependencies []coretask.UntypedTask) (T, error)

RunTaskWithDependency runs a task as a graph. Supply the dependencies of the main task to resolve the graph correctly.

func StubTask

func StubTask[T any](mockTarget coretask.Task[T], mockResult T, mockError error) coretask.Task[T]

StubTask wraps a given task to return the constant values given without calling the original task.

func StubTaskFromReferenceID

func StubTaskFromReferenceID[T any](mockTargetReference taskid.TaskReference[T], mockResult T, mockError error) coretask.Task[T]

StubTaskFromReferenceID creates a new test task return the given constant value of its result.

func WithTaskResult

func WithTaskResult[T any](ctx context.Context, taskRef taskid.TaskReference[T], value T) context.Context

WithTaskResult adds task result to the given context. It's for testing a function using coretask.GetTaskResult inside.

Types

type TaskDependencyValues

type TaskDependencyValues interface {
	Register(resultMap *typedmap.TypedMap)
}

func NewTaskDependencyValuePair

func NewTaskDependencyValuePair[T any](key taskid.TaskReference[T], value T) TaskDependencyValues

NewTaskDependencyValuePair returns a new pair of a task reference and its value.

Jump to

Keyboard shortcuts

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