selfcompose: the manifest of the build a module runs here is answered in one place; every step reads it there (A-484)
Entry of the running build, else the composition this node runs of it, else the module's trunk manifest through the seat mesh-catalog's verb module; said once per module and source; words naming the three where none answers. Read there: a held module's offer (frombus Scope.RunningManifest), FormChanges (A-483), the store holder and the stand of a running module without an entry (A-461d, A-480a), and the tool composition. Builds: design 47 G A-484, A-480, A-480a, A-483, A-461d, A-482
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||
"github.com/novox/mesh-host/internal/compose"
|
||||
"github.com/novox/mesh-host/internal/compose/resolution"
|
||||
engcomp "github.com/novox/mesh-host/internal/compositions"
|
||||
@@ -342,8 +343,8 @@ func TestASecondClaimantOfASeatIsHeldAndTheNodeComposesTheRest(t *testing.T) {
|
||||
// A-480 (design 47 G): a module the node holds keeps running what it runs, and so keeps providing what its running build provides,
|
||||
// whatever its catalogue entry: the module that requires it is not held for "nothing provides" (live, 2026-11-17 22:52: feh on g14
|
||||
// held for "x11-display" while xorg runs there, held only for want of an entry of its wanted build). The offer is the running
|
||||
// composition's build's manifest (the builder's done key), else the manifest the module's `running` event names; a module
|
||||
// neither running nor composable still gives "nothing provides".
|
||||
// manifest of the build it runs, from the one place that reads it (A-484); a module neither running nor composable still gives
|
||||
// "nothing provides".
|
||||
const xorgRunning = `{"module":"xorg","version":"1","provides":[{"name":"x11-display"}]}`
|
||||
feh := `{"module":"feh","version":"1","requires":["x11-display"]}`
|
||||
nameOnly := `{"module":"xorg","version":"0"}`
|
||||
@@ -352,18 +353,13 @@ func TestASecondClaimantOfASeatIsHeldAndTheNodeComposesTheRest(t *testing.T) {
|
||||
scope func(fps map[string]string, b *bus) Scope
|
||||
provided bool
|
||||
}{
|
||||
{"it runs a build its running event names", func(fps map[string]string, b *bus) Scope {
|
||||
digest := meshcatalogclient.ManifestDigest([]byte(xorgRunning))
|
||||
b.manifests[digest] = []byte(xorgRunning)
|
||||
return Scope{Heard: map[string]map[string]Heard{"n1": {"xorg": {Fingerprint: "src2:" + strings.Repeat("r", 64), Manifest: digest}}}}
|
||||
}, true},
|
||||
{"its composition runs a build the builder holds done", func(fps map[string]string, b *bus) Scope {
|
||||
fp := "src2:" + strings.Repeat("r", 64)
|
||||
digest := meshcatalogclient.ManifestDigest([]byte(xorgRunning))
|
||||
b.manifests[digest] = []byte(xorgRunning)
|
||||
b.builds["xorg "+fp] = &builds.BuilderBuild{State: builds.BuildDone, Manifest: digest}
|
||||
return Scope{Running: []engcomp.Composed{{Node: "n1", Module: "xorg", FP: fp}}}
|
||||
{"the one place answers the manifest of the build it runs (A-484)", func(fps map[string]string, b *bus) Scope {
|
||||
man, _ := catalogue.Decode([]byte(xorgRunning))
|
||||
return Scope{RunningManifest: func(module string) (catalogue.Manifest, bool) { return man, module == "xorg" }}
|
||||
}, true},
|
||||
{"the one place reads none", func(map[string]string, *bus) Scope {
|
||||
return Scope{RunningManifest: func(string) (catalogue.Manifest, bool) { return catalogue.Manifest{}, false }}
|
||||
}, false},
|
||||
{"nothing of it runs", func(map[string]string, *bus) Scope { return Scope{} }, false},
|
||||
} {
|
||||
b, fps := aNode(t, nameOnly, feh)
|
||||
|
||||
Reference in New Issue
Block a user