testing

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WorkerRpcAddr       = "localhost:53480"
	WorkerTelemetryAddr = "localhost:53470"

	EnvAmDbgWorkerRpcAddr       = "AM_DBG_WORKER_RPC_ADDR"
	EnvAmDbgWorkerTelemetryAddr = "AM_DBG_WORKER_TELEMETRY_ADDR"
)

Functions

func NewDbgWorker added in v0.8.0

func NewDbgWorker(
	realTty bool, opts debugger.Opts,
) (*debugger.Debugger, error)

NewDbgWorker creates a new worker instance of the am-dbg.

func NewRpcClient

func NewRpcClient(
	t *testing.T, ctx context.Context, addr string, stateStruct am.Struct,
	stateNames am.S, consumer *am.Machine,
) *rpc.Client

func NewRpcTest

func NewRpcTest(
	t *testing.T, ctx context.Context, worker *am.Machine,
	consumer *am.Machine,
) (*am.Machine, *rpc.Server, *rpc.Client)

NewRpcTest creates a new rpc server and client for testing, which exposes the passed worker as a remote one, and binds payloads to the optional consumer. TODO sync with rpc/rpc_test

func RpcGet

func RpcGet[G any](
	t *testing.T, c *rpc.Client, name server.GetField, defVal G,
) G

RpcGet retrieves a value from the RPC server.

func RpcShutdown

func RpcShutdown(ctx context.Context, c *rpc.Client, s *rpc.Server)

RpcShutdown shuts down the passed client and optionally a server.

Types

This section is empty.

Directories

Path Synopsis
cmd
am-dbg-worker
AM_DBG_WORKER_ADDR AM_DBG_ADDR
AM_DBG_WORKER_ADDR AM_DBG_ADDR

Jump to

Keyboard shortcuts

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