B0's shape wins: the running checker asks and records facts, the checking program decides. The registry's types win: the rules and the program read the generated checker contract and the domain SDK, and no mesh-sdk delivery import is left. The registry's series, renames and unparsed seat definitions become facts with their refusals as rules; the tagged versions ride on the case. The program reads the heads' seat definitions through sdk/seatdefs and the running checker lays them over its reader's list by seat, reading no file of the heads: the reader's list is larger than a run input's bound. Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
64 lines
3.0 KiB
Go
64 lines
3.0 KiB
Go
package rules
|
|
|
|
import "git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
|
|
|
// The shapes of a test step's answer, as the build modules' code writes them (mesh-catalog modules/mesh-build-go
|
|
// cmd/mesh-build-go levels.go TestResult; modules/mesh-build-node cmd/mesh-build-node check.go TestResult). Only the
|
|
// fields the rules read are named; the rest is ignored.
|
|
|
|
// GoPackage is one package of a Go test result.
|
|
type GoPackage struct {
|
|
Dir string `json:"dir"`
|
|
Package string `json:"package"`
|
|
Passed bool `json:"passed"`
|
|
Elapsed float64 `json:"elapsed"`
|
|
Tests int `json:"tests"`
|
|
NoTests bool `json:"no_tests,omitempty"`
|
|
// Skipped is how many of the package's tests skipped; an older build module names none.
|
|
Skipped int `json:"skipped,omitempty"`
|
|
}
|
|
|
|
// Failure is a test that failed, or a package that failed with no test to name: the build modules' failure contract
|
|
// (buildstep.Failure, issue 1901), its cause never empty and never a passing line from a build module that keeps it.
|
|
type Failure = buildstep.Failure
|
|
|
|
// TestTime is one test and the seconds it took.
|
|
type TestTime struct {
|
|
Package string `json:"package"`
|
|
Test string `json:"test"`
|
|
Elapsed float64 `json:"elapsed"`
|
|
}
|
|
|
|
// Tested is the answer of a test step of either build module (the Go one names packages and counts tests; the Node one
|
|
// names the package directory as Module and counts none).
|
|
type Tested struct {
|
|
Level string `json:"level"`
|
|
Module string `json:"module,omitempty"`
|
|
Passed bool `json:"passed"`
|
|
Why string `json:"why,omitempty"`
|
|
NoTests bool `json:"no_tests,omitempty"`
|
|
Tests int `json:"tests"`
|
|
Skipped int `json:"skipped"`
|
|
Packages []GoPackage `json:"packages,omitempty"`
|
|
Elapsed float64 `json:"elapsed"`
|
|
Setup float64 `json:"setup,omitempty"`
|
|
// Lint is the unit level's gofmt and go vet time, before its tests (mesh-build-go, ADR 0529 §1).
|
|
Lint float64 `json:"lint,omitempty"`
|
|
Bound float64 `json:"bound"`
|
|
SetupBound float64 `json:"setup_bound,omitempty"`
|
|
Slowest []TestTime `json:"slowest,omitempty"`
|
|
Failed []Failure `json:"failed,omitempty"`
|
|
OverBound bool `json:"over_bound"`
|
|
OverWhich string `json:"over_which,omitempty"`
|
|
// JudgedBy is the program that ran the step (ADR 0535 §5): "installed", or "candidate <merge commit>" under runner
|
|
// workspace; absent from a build module that does not take the runner.
|
|
JudgedBy string `json:"judged_by,omitempty"`
|
|
// By is the build module that answered and the SDK it was built with (buildstep.By); absent from a build module from
|
|
// before the failure contract.
|
|
By string `json:"by,omitempty"`
|
|
// OutOfStep are the generated files the step's regenerate-and-compare found out of step with their seat definitions,
|
|
// each a repository-relative path (design 26): the running checker names them in its verdict event. Absent from a
|
|
// build module that does not compare.
|
|
OutOfStep []string `json:"out-of-step,omitempty"`
|
|
}
|