Merge pull request 'Read and write placement per node and module (issue 774)' (#51) from feat/072-moves into main
This commit was merged in pull request #51.
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261030143623-83cf97b690f5
|
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a
|
||||||
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op // indirect
|
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op // indirect
|
||||||
github.com/google/go-tpm v0.9.8 // indirect
|
github.com/google/go-tpm v0.9.8 // indirect
|
||||||
github.com/klauspost/compress v1.20.0 // indirect
|
github.com/klauspost/compress v1.20.0 // indirect
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261030143623-83cf97b690f5 h1:hyyaB1rU7uzlQZvWAxZ9P6pL/4LCFpOVXMRgn9F7fic=
|
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a h1:DcSvfEmdPBKqCg5OmXRNb269EkkPe7BsEp+RykEhkgE=
|
||||||
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261030143623-83cf97b690f5/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY=
|
git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY=
|
||||||
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0=
|
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0=
|
||||||
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
|
github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI=
|
||||||
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
|
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
|
||||||
|
|||||||
@@ -398,14 +398,13 @@ func recordsOn(conn *bus.Conn) (recorded []recordedModule, machines []string, wh
|
|||||||
}
|
}
|
||||||
machines = delivery.MachineNames(placements)
|
machines = delivery.MachineNames(placements)
|
||||||
on := map[string][]string{}
|
on := map[string][]string{}
|
||||||
for _, node := range machines {
|
// The placement's keys in either form, a node key and its module keys or the form before (research 072 row 37).
|
||||||
key, _ := delivery.PlacementKey(node)
|
assembled, err := delivery.PlacementsOf(placements)
|
||||||
var p delivery.Placement
|
if err != nil {
|
||||||
if json.Unmarshal(placements[key], &p) != nil {
|
why = append(why, delivery.PlacementRead+" (not every key is a placement: "+err.Error()+")")
|
||||||
why = append(why, delivery.PlacementRead+" ("+key+" is not a placement)")
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
for _, m := range p.Modules {
|
for _, node := range machines {
|
||||||
|
for _, m := range assembled[node].Modules {
|
||||||
on[m.Module] = append(on[m.Module], node)
|
on[m.Module] = append(on[m.Module], node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,12 +201,17 @@ func (m *Mesh) Placed(t *testing.T, tools map[string][]string, on map[string][]s
|
|||||||
for _, module := range placed {
|
for _, module := range placed {
|
||||||
p.Modules = append(p.Modules, delivery.PlacedModule{Module: module})
|
p.Modules = append(p.Modules, delivery.PlacedModule{Module: module})
|
||||||
}
|
}
|
||||||
raw, _ := json.Marshal(p)
|
// As the seat writes it: its node key and a key per module (research 072 row 37).
|
||||||
key, _ := delivery.PlacementKey(node)
|
values, err := delivery.PlacementValues(p)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
for key, raw := range values {
|
||||||
if _, err := placement.Put(key, raw); err != nil {
|
if _, err := placement.Put(key, raw); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextEvent is the subject the next event under a pattern lands on.
|
// NextEvent is the subject the next event under a pattern lands on.
|
||||||
|
|||||||
Reference in New Issue
Block a user