Documentation
¶
Overview ¶
Package testselection recommends bounded verification commands from static repository evidence. Recommendations neither execute tests nor prove coverage.
Index ¶
Constants ¶
const ( // ModeTargeted runs plan-declared commands and tests with a direct static // relationship to the change (changed tests, import or contract impact, // Go package companions, cross-component integration suites). ModeTargeted = "targeted" // ModeBalanced adds conservative package-root fallbacks for changes whose // direct test relationship was not established. "recommended" is an alias. ModeBalanced = "balanced" // ModeFull runs one discovered whole-suite command per framework and // package root, plus plan-declared commands. ModeFull = "full" TierRequired = "required" TierOptional = "optional" // DefaultMaxCommands bounds one verification run after grouping. DefaultMaxCommands = 16 )
Selection modes. None of them implies complete behavioral coverage.
const MaxFileBytes int64 = 1 << 20
const MaxFiles = 10000
const MaxTotalBytes int64 = 32 << 20
Variables ¶
This section is empty.
Functions ¶
func Documentation ¶ added in v0.2.0
Documentation reports a documentation or image file, for which selection proposes no test. It describes selection only: it does not establish that no test reads the file.
func NormalizeMode ¶
NormalizeMode maps accepted spellings to a mode, or reports an error.
Types ¶
type Command ¶
type Command struct {
ID string `json:"id"`
Command []string `json:"command"`
CWD string `json:"cwd"`
Framework string `json:"framework"`
TestFiles []string `json:"test_files"`
Affected []string `json:"affected"`
EvidenceReasons []Reason `json:"evidence_reasons"`
Priority int `json:"priority"`
ToolAvailable bool `json:"tool_available"`
// Tier is required or optional; set by Plan, empty in raw proposals.
Tier string `json:"tier,omitempty"`
// GroupedFrom lists the per-file candidate IDs merged into this command.
GroupedFrom []string `json:"grouped_from,omitempty"`
// JUnit is the CWD-relative report file or TEST-*.xml directory the
// runner writes, for runners whose output carries no test counts.
JUnit string `json:"junit,omitempty"`
}
type Inventory ¶
type Inventory struct {
Revision string `json:"revision"`
Tests []Test `json:"tests"`
Diagnostics []model.Diagnostic `json:"diagnostics"`
Manifests []string `json:"manifests"`
}
type Omission ¶
type Omission struct {
ID string `json:"id"`
Command []string `json:"command"`
CWD string `json:"cwd"`
TestFiles []string `json:"test_files"`
Tier string `json:"tier"`
Reason string `json:"reason"`
Explanation string `json:"explanation"`
}
Omission records a candidate command that was not selected or not executed.
type Proposal ¶
type Proposal struct {
Omitted []Omission `json:"omitted,omitempty"`
Status model.Status `json:"status"`
Commands []Command `json:"commands"`
Inventory Inventory `json:"inventory"`
Limitations []string `json:"limitations"`
}
type Runner ¶ added in v0.2.0
type Runner struct {
Framework string `json:"framework"`
Program string `json:"program"`
Tests int `json:"tests"`
Unsupported int `json:"unsupported"`
}
Runner summarizes the discovered tests of one framework and the program their selected commands would start. Program is empty when no command is safely known for some of those tests.
type Selection ¶
type Selection struct {
Mode string `json:"mode"`
MaxCommands int `json:"max_commands"`
Commands []Command `json:"commands"`
Omitted []Omission `json:"omitted"`
Uncovered []string `json:"uncovered_changes"`
Blocking []string `json:"blocking"`
Candidates int `json:"candidate_commands"`
TestFiles int `json:"selected_test_files"`
Inventory int `json:"inventory_test_files"`
Explanation string `json:"explanation"`
}
Selection is a bounded, ordered execution plan derived from a proposal. Blocking lists reasons the selection cannot satisfy required verification; a gate must not pass on a selection with blocking reasons.
type Test ¶
type Test struct {
ID string `json:"id"`
Path string `json:"path"`
Framework string `json:"framework"`
PackageRoot string `json:"package_root"`
Evidence model.Provenance `json:"evidence"`
// contains filtered or unexported fields
}
Test is a conventional test file, not a compiler-validated executable case.