Help us shape the future of Go! Take the 2026 Go Developer Survey

inspecttest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package inspecttest holds the one fixture matrix that the integration, doctor, status, and init tests share. Each fixture puts a workspace into one inspection state and states what every consumer must report for it, so the four commands are checked against one account of setup and never drift apart. It is test support only: nothing in the shipped binary imports it.

Index

Constants

View Source
const Binary = "/usr/local/bin/seamark"

Binary is the seamark path the fixtures install hooks with.

View Source
const Secret = "sk-live-1234567890abcdef"

Secret is the credential the "redacted wrapper" fixture puts into a hook command; no consumer may print it.

View Source
const SharedID = "shared"

SharedID is the registry ID of the test-only client that shares the Codex skill directory. It exists so the matrix can pin how a shared destination is reported to every consumer, and how pending trust and unknown verification render.

Variables

This section is empty.

Functions

func Registry

func Registry() *integration.Registry

Registry is the built-in registry plus the shared test client.

func Rendered

func Rendered(insp integration.Inspection) string

Rendered joins the client's rendered state the way the consumers print it, so a fixture's Words can be checked against one string here and against each consumer's output there.

func SharedClient

func SharedClient() integration.Client

SharedClient describes the test-only client: it reads the Codex skill directory, decodes edits, and has a setup adapter that reports an installed edit hook with pending trust and no native evidence. It plans nothing and registers no MCP server.

Types

type Fixture

type Fixture struct {
	Name string
	// Write puts a workspace into the state. It uses the real setup
	// where it can, so the matrix pins what the adapters read back from
	// what they wrote.
	Write func(root string) error
	// Client is the client the expectations below are about.
	Client string
	// States are the expected states of the named capabilities.
	States map[integration.Capability]integration.CapabilityState
	// GateMode is the expected installed gate mode of the client, from
	// the definitions that certainly run the gate.
	GateMode string
	// PossibleGateMode is the expected mode of the definitions that may
	// run the gate, or "" without such a definition.
	PossibleGateMode string
	// ManagedGateMode is the expected mode of the gate hook that setup
	// manages, or "" when none runs. A plain re-run of setup keeps it.
	ManagedGateMode string
	// Findings are substrings that the client's finding reasons must
	// contain, one finding per entry.
	Findings []string
	// InitFindings are the substrings init's output must contain instead
	// of Findings, when init changes the state it inspects: setup
	// installs the managed hook, so a definition that ran alone now runs
	// beside it. Nil means Findings.
	InitFindings []string
	// Words are substrings of the client's rendered state that every
	// consumer prints: the hooks phrase, the registration, the grants,
	// and the skills detail (see Rendered). A word about an unsupported
	// capability or a shared directory belongs to the integration test
	// alone: doctor and status print those in their own ways.
	Words []string
	// Skills is a substring of the skills summary line every consumer
	// prints, labelled by destination consumers ("codex+shared 3/3
	// current"); empty when the fixture says nothing about it.
	Skills string
	// Absent are substrings that must appear in no consumer's output:
	// a credential a hook command carries.
	Absent []string
	// Invoker is the expected name of the resolved inference command;
	// empty means the default Claude preset.
	Invoker string
	// InvokerMissing is true when the fixture points the invoker at an
	// executable that is not on PATH.
	InvokerMissing bool
}

Fixture is one inspection state with the expectations every consumer must meet.

func Fixtures

func Fixtures() []Fixture

Fixtures returns the matrix. The names follow the plan's list of states: absent, current, partial, foreign, malformed, restricted, pending trust, unknown verification, shared skills, and missing invoker. The other fixtures hold the limitations that the adapters report:

  • hooks turned off;
  • a handler that runs twice;
  • a wrapped handler in the personal file;
  • an enforcing inline handler beside the managed warn hook;
  • a gate command under a matcher that never fires;
  • a wrapper that carries a credential.

Two managed gate hooks enforce. One is under a "*" matcher, which a substring test for "Bash" misses. The other is the Codex hook.

func Named

func Named(name string) Fixture

Named returns the fixture with the name; it panics on an unknown name, so a test never runs against the wrong state in silence.

Jump to

Keyboard shortcuts

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