testrunner

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Overview

Package testrunner defines experimental, runner-neutral execution observations. Its parsers describe native reports; no state proves semantic test adequacy.

Index

Constants

View Source
const (
	Passed                 = "PASSED"
	Failed                 = "FAILED"
	Skipped                = "SKIPPED"
	Flaky                  = "FLAKY"
	TimedOut               = "TIMED_OUT"
	Interrupted            = "INTERRUPTED"
	Unknown                = "UNKNOWN"
	Assertion              = "ASSERTION"
	BuildFailure           = "BUILD"
	CollectionFailure      = "COLLECTION"
	Infrastructure         = "INFRASTRUCTURE"
	Retained               = "RETAINED"
	NotReported            = "NOT_REPORTED"
	NotApplicable          = "NOT_APPLICABLE"
	MaxPinnedArtifactBytes = 256 << 20
	MaxReportBytes         = 4 << 20
	MaxTests               = 4096
	MaxAttempts            = 32
	MaxReports             = 32
)

Variables

This section is empty.

Functions

func DecodeDocument

func DecodeDocument(b []byte, out any) error

DecodeDocument rejects duplicate, trailing and unknown fields, including in nested tool declarations. Documents remain operator declarations, not proof.

func Digest

func Digest(b []byte) string

Digest identifies retained bytes, not their authority or causal provenance.

func Identity

func Identity(v any) string

Types

type Attempt

type Attempt struct {
	State       string `json:"state"`
	FailureKind string `json:"failureKind"`
	Message     string `json:"message"`
}

type Execution

type Execution struct {
	Profile            string            `json:"profile"`
	Runner             string            `json:"runner"`
	InputSha256        string            `json:"inputSha256"`
	InvocationSha256   string            `json:"invocationSha256"`
	Phases             []PhaseResult     `json:"phases"`
	ReportSha256       map[string]string `json:"reportSha256"`
	Input              Input             `json:"-"`
	ExecutionAuthority string            `json:"executionAuthority"`
	DependencyClosure  string            `json:"dependencyClosure"`
}

func Execute

func Execute(ctx context.Context, r Request, inv Invocation) (out Execution, retErr error)

Execute runs an already re-derived profile invocation. Caller must bind its admitted request and exact invocation digest before calling; parsers never call Execute. The declared input inventory is not full dependency attestation.

type Input

type Input struct {
	Target                  string            `json:"target"`
	SourceRoot              string            `json:"sourceRoot"`
	Selectors               []string          `json:"selectors"`
	SourceFile              string            `json:"sourceFile"`
	ExecutionProblems       []Problem         `json:"executionProblems"`
	OutcomeNeutralExitCodes []int             `json:"outcomeNeutralExitCodes"`
	SuccessExitCodes        []int             `json:"successExitCodes"`
	FailureExitCodes        []int             `json:"failureExitCodes"`
	Runner                  string            `json:"runner"`
	Reports                 map[string][]byte `json:"reports"`
	Stdout                  []byte            `json:"stdout"`
	Stderr                  []byte            `json:"stderr"`
	ExitCode                int               `json:"exitCode"`
	TimedOut                bool              `json:"timedOut"`
	Interrupted             bool              `json:"interrupted"`
	Overflow                bool              `json:"overflow"`
	Expected                []string          `json:"expected"`
}

type Invocation

type Invocation struct {
	OutcomeNeutralExitCodes []int             `json:"outcomeNeutralExitCodes"`
	SuccessExitCodes        []int             `json:"successExitCodes"`
	FailureExitCodes        []int             `json:"failureExitCodes"`
	Argv                    []string          `json:"argv"`
	Phases                  []Phase           `json:"phases"`
	Files                   map[string][]byte `json:"files"`
	ReportPaths             []string          `json:"reportPaths"`
	ReportPatterns          []string          `json:"reportPatterns"`
	Environment             map[string]string `json:"environment"`
	Format                  string            `json:"format"`
	GracefulInterrupt       bool              `json:"gracefulInterrupt,omitempty"`
}

type Observation

type Observation struct {
	Runner           string    `json:"runner"`
	Tests            []Test    `json:"tests"`
	Problems         []Problem `json:"problems"`
	Complete         bool      `json:"complete"`
	RetryInformation string    `json:"retryInformation"`
}

func Normalize

func Normalize(in Input, o Observation) Observation

Normalize enforces the shared boundary after runner-specific parsing.

type Phase

type Phase struct {
	StdoutReport string            `json:"stdoutReport"`
	Kind         string            `json:"kind"`
	Tool         string            `json:"tool"`
	Argv         []string          `json:"argv"`
	Environment  map[string]string `json:"environment"`
}

type PhaseResult

type PhaseResult struct {
	Kind         string `json:"kind"`
	ToolSha256   string `json:"toolSha256"`
	ArgvSha256   string `json:"argvSha256"`
	StdoutSha256 string `json:"stdoutSha256"`
	StderrSha256 string `json:"stderrSha256"`
	ExitCode     int    `json:"exitCode"`
	TimedOut     bool   `json:"timedOut"`
	Interrupted  bool   `json:"interrupted"`
	Overflow     bool   `json:"overflow"`
}

type PlanDocument

type PlanDocument struct {
	Profile    string     `json:"profile"`
	Request    Request    `json:"request"`
	Invocation Invocation `json:"invocation"`
}

PlanDocument and ReceiptDocument preserve the runner companion's exact JSON field order: plan identity is the digest of this native serialization.

type Problem

type Problem struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

type ReceiptDocument

type ReceiptDocument struct {
	Profile     string      `json:"profile"`
	PlanSha256  string      `json:"planSha256"`
	Execution   Execution   `json:"execution"`
	Observation Observation `json:"observation"`
	Error       string      `json:"error"`
}

type Request

type Request struct {
	ExpectedTests    []string          `json:"expectedTests"`
	Target           string            `json:"target"`
	InputFiles       map[string]string `json:"inputFiles"`
	Runner           string            `json:"runner"`
	Root             string            `json:"root"`
	Executable       string            `json:"executable"`
	ExecutableSha256 string            `json:"executableSha256"`
	Selectors        []string          `json:"selectors"`
	Project          string            `json:"project"`
	Config           string            `json:"config"`
	ConfigSha256     string            `json:"configSha256"`
	Reporter         string            `json:"reporter"`
	ReporterSha256   string            `json:"reporterSha256"`
	ReportFiles      []string          `json:"reportFiles"`
	Tools            map[string]Tool   `json:"tools"`
	ReportDir        string            `json:"reportDir"`
	TimeoutSeconds   int               `json:"timeoutSeconds"`
}

type Test

type Test struct {
	Granularity   string    `json:"granularity,omitempty"`
	ExecutedCount *int      `json:"executedCount,omitempty"`
	SkippedCount  *int      `json:"skippedCount,omitempty"`
	FailureKind   string    `json:"failureKind"`
	Message       string    `json:"message"`
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	File          string    `json:"file"`
	Suite         string    `json:"suite"`
	State         string    `json:"state"`
	Attempts      []Attempt `json:"attempts"`
}

type Tool

type Tool struct {
	Executable string `json:"executable"`
	Sha256     string `json:"sha256"`
}

Directories

Path Synopsis
Package dynamic implements explicit experimental dynamic-language runner profiles.
Package dynamic implements explicit experimental dynamic-language runner profiles.
Package mobile observes a bounded experimental Appium Android runner tuple.
Package mobile observes a bounded experimental Appium Android runner tuple.
Package native adapts explicit native runner profiles.
Package native adapts explicit native runner profiles.
Package platform reads runner-specific JVM, Apple and shell observations.
Package platform reads runner-specific JVM, Apple and shell observations.
Package registry composes explicit experimental runner profiles without letting one language's result hide another provider's unknown frontier.
Package registry composes explicit experimental runner profiles without letting one language's result hide another provider's unknown frontier.
Package sql observes two bounded experimental native SQL runner profiles.
Package sql observes two bounded experimental native SQL runner profiles.

Jump to

Keyboard shortcuts

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