agenttest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 12 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

Overview

Package agenttest is a fixture that drives agent.Run in-process as a plain user against a local git repository, for the agent's own tests and the conformance suite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	Repo, Root string
	Spec       agent.Spec
	K          []byte
	HTTP       *http.Client
	Deadline   time.Time
	SelfDelete func()
	// NoListener runs the job in no-listener mode (spec port -1): there is no results server and
	// the agent exits by itself after result.json, so Run does not set NoServe.
	NoListener bool
	// System replaces PlainSystem; StateRoot, SelfSHA, KeyRoot and KeepAlive are Options' fields.
	System    agent.System
	StateRoot string
	SelfSHA   func() (string, error)
	KeyRoot   string
	KeepAlive *agent.KeepAliveConf
}

Fixture is one fake job: a repo with run.sh and sub/keep, and the spec that clones it.

func NewFixture

func NewFixture(t *testing.T, script string) *Fixture

NewFixture commits script as run.sh in a fresh repo and prepares a spec for it.

func (*Fixture) Run

func (f *Fixture) Run(t *testing.T) (string, int)

Run drives agent.Run once and returns the agent's stdout and exit code.

Jump to

Keyboard shortcuts

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