build modules: every one runs the step-ends kit case; failurekit refuses one that does not; image and go count runs that started
mesh-build-image's steps now carry Node and SayStep (an image has no step, §328, but the kit holds all three). Prior wired in go and image. Builds: design 47 G §24, §328 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -91,7 +91,7 @@ func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Pul
|
||||
if m.SayEvent != nil {
|
||||
say = steprun.SayOn(sdkstep.AskGo, m.Node, m.SayEvent)
|
||||
}
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskGo, Say: say, Callers: m.Callers, Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskGo, Say: say, Callers: m.Callers, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
Capacity: capacity, SettingsFile: settings, WatchConfig: watch, CoresPerStep: cores, BuildHours: hours, Logf: m.Say, Has: m.Has,
|
||||
Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) {
|
||||
if err := m.Check(ctx); err != nil {
|
||||
|
||||
@@ -56,3 +56,9 @@ func TestTheStepsSayAFailedNetworkAsATransportFault(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Design 47 G §24 (*Asked on a work queue, ended by an event*): the module's own steps can say a pipeline step's end, or
|
||||
// every step ask the runner sends it is refused ("this build module says no step's end"), as the first live pipeline met.
|
||||
func TestTheStepsCanSayAStepsEnd(t *testing.T) {
|
||||
conformance.StepEnds(t, (&Module{Node: "kitnode"}).askSteps(nil))
|
||||
}
|
||||
|
||||
@@ -31,9 +31,20 @@ func (m *Module) askSteps(steps []StepTool) steprun.AskSteps {
|
||||
Fetch: byName["build_image_fetch"], Build: byName["build_image_build"], Copy: byName["build_image_copy"],
|
||||
Release: func(ws string) error { return m.spaces().Release(ws) },
|
||||
Logf: m.Say,
|
||||
Node: m.Node,
|
||||
SayStep: m.sayStep(),
|
||||
}
|
||||
}
|
||||
|
||||
// sayStep says a step ask's end on this node's subject of the seat (design 47 G §24): an image has no lint, unit or integration
|
||||
// step (§328), so none is asked of this seat, but the steps of every build module can say their ends, which the kit holds.
|
||||
func (m *Module) sayStep() func(sdkstep.StepEnded) error {
|
||||
if m.SayStep != nil {
|
||||
return m.SayStep
|
||||
}
|
||||
return steprun.SayStepOn(sdkstep.AskImage, m.Node, stdio.SeatPublish)
|
||||
}
|
||||
|
||||
// Puller is the module's pull of its seat's asks, on source (the runtime's seat pull when nil).
|
||||
func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Puller {
|
||||
if source == nil {
|
||||
@@ -69,7 +80,7 @@ func (m *Module) Puller(steps []StepTool, source steprun.AskSource) *steprun.Pul
|
||||
if m.SayEvent != nil {
|
||||
say = steprun.SayOn(sdkstep.AskImage, m.Node, m.SayEvent)
|
||||
}
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskImage, Say: say, Callers: m.Callers, Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
return &steprun.Puller{KeepOutput: steprun.KeepOutputIn(m.Outputs), Source: source, Language: sdkstep.AskImage, Say: say, Callers: m.Callers, Prior: steprun.PriorRuns(m.ReadSteps.Get), Node: m.Node, Put: m.Steps, PausePut: m.Pauses, Load: load, ForgetPause: m.ForgetPause, WatchPauses: m.WatchPauses, PauseKeys: m.ReadPauses.Keys,
|
||||
Capacity: capacity, SettingsFile: settings, WatchConfig: watch, CoresPerStep: cores, BuildHours: hours, Eligible: m.Eligible, Logf: m.Say,
|
||||
Run: func(ctx context.Context, a sdkstep.StepAsk) (any, error) {
|
||||
if err := m.Check(ctx); err != nil {
|
||||
|
||||
@@ -44,3 +44,9 @@ func TestTheStepsSayAFailedNetworkAsATransportFault(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Design 47 G §24 (*Asked on a work queue, ended by an event*): the module's own steps can say a pipeline step's end, or
|
||||
// every step ask the runner sends it is refused ("this build module says no step's end"), as the first live pipeline met.
|
||||
func TestTheStepsCanSayAStepsEnd(t *testing.T) {
|
||||
conformance.StepEnds(t, (&Module{Node: "kitnode"}).askSteps(nil))
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ type Module struct {
|
||||
// SayEvent publishes an event of the image build seat on a seat subject (stdio.SeatPublish; nil says none, a test's): the
|
||||
// puller's ask-taken, step-progress and step-ended (design 47 G §496, §602).
|
||||
SayEvent func(subject string, body any, id string) error
|
||||
// SayStep says a step ask's end (steprun.AskSteps.SayStep); the seat's publish on this node when nil (a test's own).
|
||||
SayStep func(sdkstep.StepEnded) error
|
||||
|
||||
Node string
|
||||
// RecordAct writes an act in the hand-act log of the seat mesh-hand-acts (§463, §480): a drop writes it first.
|
||||
|
||||
@@ -49,3 +49,9 @@ func TestTheStepsSayAFailedNetworkAsATransportFault(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Design 47 G §24 (*Asked on a work queue, ended by an event*): the module's own steps can say a pipeline step's end, or
|
||||
// every step ask the runner sends it is refused ("this build module says no step's end"), as the first live pipeline met.
|
||||
func TestTheStepsCanSayAStepsEnd(t *testing.T) {
|
||||
conformance.StepEnds(t, (&Module{Node: "kitnode"}).askSteps(nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user