Documentation
¶
Index ¶
- func AddedJobID(t *testing.T, result Result) string
- func AssertPairOutcome(t *testing.T, r Result)
- func BuildRotari(path string) error
- func GuardedCommands(project string) map[string][]string
- func JobProcesses(t *testing.T, root, job string) int
- func KillProcessGroup(pid int) error
- func KillStrays(t *testing.T, root string)
- func KillSupervisors(t *testing.T, root string)
- func PairAdapter(command string) string
- func PairHasFlag(flags []PairFlag, name string) bool
- func PairIntersect(a, b []string) []string
- func PairMutationRevision(t *testing.T, e *Env) string
- func Run(m *testing.M) int
- func TrackBuildInputs(t testing.TB)
- func WaitForInterrupted(t *testing.T, e *Env, project string)
- func WaitUntil(t *testing.T, timeout time.Duration, done func() (bool, string))
- type ActiveRun
- type CoordinatorProcess
- type Env
- func (e *Env) CheckState(project string) string
- func (e *Env) Command(args ...string) *exec.Cmd
- func (e *Env) CreateFinishedRun() FinishedRun
- func (e *Env) ExportFinishedRun(project string) string
- func (e *Env) FinishedJobRun(project string) (runID, attemptID string)
- func (e *Env) HTTPDo(method, url string, headers map[string]string, body string) HTTPResult
- func (e *Env) HTTPGet(url string) HTTPResult
- func (e *Env) HTTPPostJSON(url string, body any) HTTPResult
- func (e *Env) In(dir string) *Env
- func (e *Env) JobExitStatus(project, jobID string) string
- func (e *Env) MustRotari(args ...string) Result
- func (e *Env) OrphanRun(project, script string) string
- func (e *Env) Rotari(args ...string) Result
- func (e *Env) Setenv(name, value string)
- func (e *Env) StartRun(project string, count int, async bool, runArgs ...string) ActiveRun
- func (e *Env) StartTableView(path string, args ...string) string
- func (e *Env) StartWeb(args ...string) string
- func (e *Env) WithVar(name, value string) *Env
- func (e *Env) Without(name string) *Env
- type FinishedRun
- type FlagPair
- type HTTPResult
- type PairCommand
- type PairFixture
- type PairFlag
- type PairMutationFixture
- type PairMutationResult
- type PairSavedFile
- type PairSavedTree
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertPairOutcome ¶
func BuildRotari ¶
BuildRotari builds cmd/rotari at path for a conformance test binary. Commands that run the binary must call TrackBuildInputs.
func GuardedCommands ¶
GuardedCommands are the project commands that a running or interrupted project rejects. Queue edits are not among them: the queue holds only the next run's jobs.
func KillProcessGroup ¶
func KillStrays ¶
func KillSupervisors ¶
KillSupervisors kills the supervisor processes of runs under root, as a crash would, and leaves their jobs running.
func PairAdapter ¶
One execution classification shared by the inventory and runners. Missing adapters are deferred explicitly rather than counted as passing tests.
func PairHasFlag ¶
func PairIntersect ¶
func TrackBuildInputs ¶
TrackBuildInputs makes a cached test result depend on rotari's sources.
BuildRotari runs `go build` in a subprocess, which Go's test cache does not observe, so a cached conformance result would survive a change to rotari. The cache does record files the test process stats while tests run (not in TestMain), so every command that runs the built binary calls this: it stats each file under the module's cmd and internal directories, plus go.mod and go.sum, once per test binary.
Types ¶
type CoordinatorProcess ¶
type CoordinatorProcess struct {
Host string `json:"host"`
PID int `json:"pid"`
PIDNamespace string `json:"pid_namespace"`
ProcessStart string `json:"process_start"`
}
func CurrentCoordinator ¶
func CurrentCoordinator(t *testing.T) CoordinatorProcess
func ProcessIdentity ¶
func ProcessIdentity(t *testing.T, pid int) CoordinatorProcess
type Env ¶
type Env struct {
T *testing.T
Root string
Base string
Master string
// contains filtered or unexported fields
}
func (*Env) CheckState ¶
func (*Env) Command ¶
Command returns an unstarted rotari command in e's environment, for a test that talks to the process itself, such as over its stdin.
func (*Env) CreateFinishedRun ¶
func (e *Env) CreateFinishedRun() FinishedRun
func (*Env) ExportFinishedRun ¶
func (*Env) FinishedJobRun ¶
func (*Env) HTTPDo ¶
HTTPDo sends one request with headers; a "Host" header sets the request's Host. body, when not empty, is sent as JSON.
func (*Env) HTTPGet ¶
func (e *Env) HTTPGet(url string) HTTPResult
func (*Env) HTTPPostJSON ¶
func (e *Env) HTTPPostJSON(url string, body any) HTTPResult
func (*Env) JobExitStatus ¶
func (*Env) MustRotari ¶
func (*Env) StartTableView ¶
StartTableView starts rotari tableview on path and returns its URL.
type FinishedRun ¶
type FlagPair ¶
type FlagPair struct{ A, B PairFlag }
func CommandFlagPairs ¶
func CommandFlagPairs(c PairCommand) []FlagPair
type HTTPResult ¶
type PairCommand ¶
func ReadPairSchema ¶
func ReadPairSchema(t *testing.T, e *Env) []PairCommand
type PairFixture ¶
func NewPairFixture ¶
func NewPairFixture(t *testing.T) PairFixture
type PairMutationFixture ¶
type PairMutationFixture struct {
PairFixture
Initial PairSavedTree
// Current is the tree as last observed after an invocation; Restore
// diffs against it.
Current *PairSavedTree
Revision string
SecondRun string
Manifest string
}
func NewPairMutationFixture ¶
func NewPairMutationFixture(t *testing.T) PairMutationFixture
type PairMutationResult ¶
type PairSavedFile ¶
type PairSavedTree ¶
type PairSavedTree []PairSavedFile
A byte-for-byte initial tree, including directory mtimes used by latest-run lookup. All paths are relative to the harness-owned temporary root. No active supervisor/job is allowed while this snapshot is captured or restored.
func SavePairTree ¶
func SavePairTree(t *testing.T, root string) PairSavedTree
func (PairSavedTree) Observation ¶
func (tree PairSavedTree) Observation(t *testing.T) map[string]string
Only the project's newly written meta.updated_at is nondeterministic. All other content (IDs, queue definitions, results, registry, modes) stays exact.
func (PairSavedTree) Raw ¶
func (tree PairSavedTree) Raw() map[string]string
func (PairSavedTree) Restore ¶
func (tree PairSavedTree) Restore(t *testing.T, root string, current PairSavedTree)
Restore returns root to tree, given current, the snapshot taken after the last invocation. It rewrites only entries that differ, which matters on network filesystems where rewriting the whole tree per invocation dominated the runtime. Every entry's path, type, mode, and modification time is then checked against tree; contents are exact because unchanged entries had equal contents in current and changed ones are rewritten from tree.
type Result ¶
func PairInvoke ¶
Adapters own isolation and restoration for mutating commands. Finished runs ensure --follow exits; the deadline is a failure bound, never an expected result.