tests

package
v1.10.1-rc2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0 modules, 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

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.

Directories

Path Synopsis
Package regtestutil exposes a small fixture for spinning up an in-process registry server (and dialed client) for daemon-side tests.
Package regtestutil exposes a small fixture for spinning up an in-process registry server (and dialed client) for daemon-side tests.

Jump to

Keyboard shortcuts

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