testrig

package
v0.10.0-dev.37 Latest Latest
Warning

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

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

Documentation

Overview

Package testrig is the in-process harness, Start running app.Run on a temp directory and a loopback listener, and holds the module-wide checks: the retired modules, the retained set the dead-code roots name, and import confinement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Mutate edits app.Config before Run; later landings set their fakes here.
	Mutate func(*app.Config)
	// Config is written to the temp config path before boot; nil leaves it
	// absent.
	Config []byte
}

Options configures one rig.

type Rig

type Rig struct {
	// Settings is the app's settings service, for saves before an HTTP
	// route exists.
	Settings *settings.Service
	Client   *http.Client

	URL   string
	Paths app.Paths
	// contains filtered or unexported fields
}

Rig is one running app.

func Start

func Start(tb testing.TB, o Options) *Rig

Start runs app.Run until the test ends, once /api/health answers 200, and fails the test if Run returned an error other than the shutdown it caused.

func (*Rig) Stop

func (r *Rig) Stop() error

Stop cancels Run and returns its error; later calls return the same.

Jump to

Keyboard shortcuts

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