testutils

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID added in v0.8.0

type ID string

type Namespace added in v0.8.0

type Namespace string

type Secrets added in v0.8.0

type Secrets map[Namespace]map[ID]string

type TestRuntime

type TestRuntime struct {
	sdkimpl.Runtime
	// contains filtered or unexported fields
}

TestRuntime is a Runtime implementation meant for use in unit tests. Note that it should always be constructed via NewRuntime.

func NewRuntime added in v0.5.0

func NewRuntime(tb testing.TB, secrets Secrets) *TestRuntime

NewRuntime creates a new TestRuntime for use in tests. A nil Secrets map is treated as an empty map, but entries cannot be added later. The secrets map is used directly by the TestRuntime; changes to entries will be reflected in subsequent calls to GetSecret.

func (*TestRuntime) GetLogs

func (t *TestRuntime) GetLogs() [][]byte

GetLogs returns a copy of all logs written to the TestRuntime's logger.

func (*TestRuntime) SetNodeRandomSource

func (t *TestRuntime) SetNodeRandomSource(source rand.Source)

SetNodeRandomSource sets the random source used by the Node mode. Note that once the first random is called, changes will have no effect.

func (*TestRuntime) SetRandomSource

func (t *TestRuntime) SetRandomSource(source rand.Source)

SetRandomSource sets the random source used by the DON mode. Note that once the first random is called, changes will have no effect.

func (*TestRuntime) SetTimeProvider added in v1.1.3

func (t *TestRuntime) SetTimeProvider(timeProvider func() time.Time)

SetTimeProvider sets the time provider that will be used when Now is called on the Runtime

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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