The runner, the toolchain guard, the fetch, the parsers, buildcpu, the conformance kit and mesh-pack move from mesh-sdk's buildstep into modules/mesh-build-go/buildstep (own go.mod). mesh-build-go, mesh-build-node and mesh-build-image require it by a same-repository replace; what the delivery parts read (the failure contract, the fetch request, the stale sweep, the module tree shape, NewID, CapacitySetting) stays imported from mesh-sdk as sdkstep. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep/conformance"
|
|
sdkstep "git.novox.be/novox/mesh-sdk/go/buildstep"
|
|
)
|
|
|
|
// 1901/AC7: the module's own parse path (readGoTest, then the level's judging) keeps the failure contract on every captured
|
|
// go test -json case of the SDK's conformance kit, and its result names the module that sent it.
|
|
func TestTheTestStepKeepsTheFailureContract(t *testing.T) {
|
|
conformance.Run(t, conformance.GoTest, func(o conformance.Output) []sdkstep.Failure {
|
|
res := &TestResult{Level: LevelUnit, By: sdkstep.By("mesh-build-go")}
|
|
readGoTest(res, ".", o.Stdout)
|
|
res.judge(Bounds{Run: UnitBound})
|
|
if res.Passed {
|
|
t.Errorf("a failed run judged passed: %+v", res)
|
|
}
|
|
return res.Failed
|
|
})
|
|
}
|
|
|
|
// 1890/AC7: the module's own start sweep (endLeftRunning, as main runs it) keeps the conformance kit's left-running
|
|
// case: a step a previous process left running is ended at once and said, whatever its age, and a step of this process
|
|
// is kept.
|
|
func TestTheStartSweepEndsWhatAPreviousProcessLeft(t *testing.T) {
|
|
conformance.LeftRunning(t, func(ctx context.Context, scan sdkstep.Scan, node string, before time.Time, logf func(string, ...any)) {
|
|
(&Module{Node: node}).endLeftRunning(ctx, scan, before, logf)
|
|
})
|
|
}
|