Merge branch 'feat/47-G-fix11-a2' into feat/47-G-fix11-a3
# Conflicts: # node-tools/internal/console/wait_test.go
This commit is contained in:
@@ -445,6 +445,25 @@ func (w wiring) Drop(owner, state string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Halves is the catalog half of each followed branch, by branch: its revision, with the seat definitions it was judged
|
||||
// with, and its entries; mesh_wait checks an event name's emitter against them (design 34 every-event §14). An error says
|
||||
// the half has no first view yet, never that no module exists.
|
||||
func (v *Views) Halves() (map[string]meshcatalogclient.Half, error) {
|
||||
if v.branches == nil {
|
||||
return nil, fmt.Errorf("the tool runner does not follow the catalog half")
|
||||
}
|
||||
if err := v.branches.Ready(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := map[string]meshcatalogclient.Half{}
|
||||
for _, branch := range v.branches.Followed() {
|
||||
if c, ok := v.branches.Catalog(branch); ok {
|
||||
out[branch], _ = c.View() // a branch at none-yet is ready and empty (§614)
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Modules is every module the catalog half holds, by name, with its entry: the entries of the watched branches' newest trunk
|
||||
// revisions, the branch followed first naming a module more than one hold (design 47 G §196, §594). An error says the half has
|
||||
// no first view yet, never that no module exists.
|
||||
|
||||
@@ -158,6 +158,10 @@ func TestTheRunnerHoldsTheFourStatesFromTheOwnersFirstViewsAndTheirEvents(t *tes
|
||||
t.Fatal(err)
|
||||
}
|
||||
eventually(t, "the catalog-revision was not taken", func() bool { m, err := v.Modules(); return err == nil && len(m) == 2 })
|
||||
// And the halves by branch, with their revision, which mesh_wait names checking an emitter (design 34 every-event §14).
|
||||
if h, err := v.Halves(); err != nil || h["main"].Revision.Revision != 4 || len(h["main"].Entries) != 2 {
|
||||
t.Errorf("the halves: %+v, %v", h, err)
|
||||
}
|
||||
|
||||
// Events: the next revision is applied; an old one passed over; a deletion removes; none of it asks again.
|
||||
asked := func(tool string) int { o.mu.Lock(); defer o.mu.Unlock(); return o.asked[tool] }
|
||||
|
||||
Reference in New Issue
Block a user