BM4: each build module keeps a run's test output in its outputs objects
The Go build module's level answers its text in output (test2json's Output lines), the Node build module's what its commands wrote; the delivery SDK's step run keeps it as <node>.<ask> in the module's outputs objects, which each module asks for in requires (1 GiB, kept 7 days) and reads through the verb output at form 2. Each module's kit test runs the SDK's SeatVerbs. Builds: design 47 H2 §791, §820; H-A-412 (1), H-A-412 second addendum (a), H-A-421, H-A-434
This commit is contained in:
@@ -75,6 +75,10 @@ type TestResult struct {
|
||||
// By is the build module and the SDK it was built with (sdkstep.By): the checker names it when a failure hides
|
||||
// its cause.
|
||||
By string `json:"by,omitempty"`
|
||||
// Output is the level's text (design 47 H2 §791, H-A-412 second addendum (a)): what each command the level ran wrote,
|
||||
// its stdout then its stderr, in the order they ran. The delivery SDK's step run takes it out of the answer and keeps
|
||||
// it as the run's output in the outputs objects; it is never part of a check's answer.
|
||||
Output string `json:"output,omitempty"`
|
||||
// OutOfStep are the generated TypeScript files of a contracts module out of step with the seat generator (CAT-BN2,
|
||||
// steprun.OutOfStep): the unit level fails on any, Why naming each. Absent when none is.
|
||||
OutOfStep []string `json:"out-of-step,omitempty"`
|
||||
@@ -156,6 +160,7 @@ func (m *Module) testLevel(ctx context.Context, args map[string]any) (*TestResul
|
||||
}
|
||||
var check, run time.Duration
|
||||
var failed []Failure
|
||||
var text strings.Builder
|
||||
tested := false
|
||||
for _, tg := range targets {
|
||||
scripts, err := packageScripts(tg.dir)
|
||||
@@ -176,6 +181,8 @@ func (m *Module) testLevel(ctx context.Context, args map[string]any) (*TestResul
|
||||
}
|
||||
// a command that could not start is not a verdict: the step fails. One that ran and said no is.
|
||||
ran := func(name string, r forgekey.Ran, report string) error {
|
||||
text.WriteString(r.Stdout)
|
||||
text.WriteString(r.Stderr)
|
||||
if r.Err != "" {
|
||||
return fmt.Errorf("%s could not be run: status %d %s: %s", name, r.Status, r.Err, firstLine(r.Stderr))
|
||||
}
|
||||
@@ -225,7 +232,7 @@ func (m *Module) testLevel(ctx context.Context, args map[string]any) (*TestResul
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
res.Failed = failed
|
||||
res.Failed, res.Output = failed, text.String()
|
||||
var why []string
|
||||
for _, f := range failed {
|
||||
why = append(why, failureWhy(f))
|
||||
|
||||
Reference in New Issue
Block a user