tests

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TestAdminToken = "test-admin-secret"

TestAdminToken is the admin token used in tests for network creation.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaemonInfo

type DaemonInfo struct {
	Daemon     *daemon.Daemon
	Driver     *driver.Driver
	SocketPath string
}

DaemonInfo holds references for a started daemon and its driver.

type TestEnv

type TestEnv struct {
	Beacon   *beacon.Server
	Registry *registry.Server

	// Resolved addresses (only valid after Start)
	BeaconAddr   string
	RegistryAddr string
	AdminToken   string
	// contains filtered or unexported fields
}

TestEnv manages a complete Pilot Protocol test environment with OS-assigned ports and proper readiness signaling (no time.Sleep).

func NewTestEnv

func NewTestEnv(t *testing.T) *TestEnv

NewTestEnv creates and starts a beacon + registry with OS-assigned ports. Call AddDaemon() to add daemons after creation.

func (*TestEnv) AddDaemon

func (env *TestEnv) AddDaemon(opts ...func(*daemon.Config)) *DaemonInfo

AddDaemon starts a daemon connected to this environment's registry/beacon. Optional config overrides can be applied via the opts function.

func (*TestEnv) AddDaemonOnly

func (env *TestEnv) AddDaemonOnly(opts ...func(*daemon.Config)) (*daemon.Daemon, string)

AddDaemonOnly starts a daemon without creating a driver (for tests that need to manage the driver lifecycle separately).

func (*TestEnv) Close

func (env *TestEnv) Close()

Close stops all drivers, daemons, and servers.

func (*TestEnv) SocketPath

func (env *TestEnv) SocketPath(name string) string

SocketPath returns a unique socket path within the temp directory.

Jump to

Keyboard shortcuts

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