Place mesh-controller beside the node-engine's tests, which read its manifest (issue 1295, R4g)
mesh/delivery-group group feat/r4g failed: a member failed
mesh/delivery covered after its failure: a later walk that contains it was delivered: plan-1792777718506798022 (novox/mesh-delivery at fae4d48e into main…
mesh/check checking b2c545c40aec on 85aca46348a0 | novox/mesh-delivery#27 in group feat/r4g
mesh/delivery-group group feat/r4g failed: a member failed
mesh/delivery covered after its failure: a later walk that contains it was delivered: plan-1792777718506798022 (novox/mesh-delivery at fae4d48e into main…
mesh/check checking b2c545c40aec on 85aca46348a0 | novox/mesh-delivery#27 in group feat/r4g
This commit is contained in:
@@ -26,7 +26,7 @@ const (
|
|||||||
// checks/deps). Which commit of each is besideCommit's rule.
|
// checks/deps). Which commit of each is besideCommit's rule.
|
||||||
var besideRules = map[string][]string{
|
var besideRules = map[string][]string{
|
||||||
controllerRepo: {catalogueRepository, nodeEngineRepo, SDKRepository},
|
controllerRepo: {catalogueRepository, nodeEngineRepo, SDKRepository},
|
||||||
nodeEngineRepo: {catalogueRepository, SDKRepository},
|
nodeEngineRepo: {catalogueRepository, SDKRepository, controllerRepo},
|
||||||
SDKRepository: {catalogueRepository, nodeEngineRepo},
|
SDKRepository: {catalogueRepository, nodeEngineRepo},
|
||||||
catalogueRepository: {SDKRepository, controllerRepo},
|
catalogueRepository: {SDKRepository, controllerRepo},
|
||||||
"novox/mesh-delivery": {SDKRepository, catalogueRepository},
|
"novox/mesh-delivery": {SDKRepository, catalogueRepository},
|
||||||
|
|||||||
@@ -244,6 +244,39 @@ func TestTheSiblingsAreWhereTheTestsStateThem(t *testing.T) { // review D2, ADR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1295/R4g: the node-engine's tests read the controller's manifest, so a mesh-host pull request has mesh-controller beside it:
|
||||||
|
// at the group member's head when the group holds one, else at its trunk.
|
||||||
|
func hostCase(t *testing.T, pulls ...delivery.CandidatePull) *Case {
|
||||||
|
t.Helper()
|
||||||
|
c, err := delivery.DecodeCandidate(candidateOf(t, "feat/x", pulls...))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
cs := CaseOf(c, map[string]string{"novox/mesh-host": trunkA, controllerRepo: trunkA2})
|
||||||
|
if cs == nil {
|
||||||
|
t.Fatal("no case")
|
||||||
|
}
|
||||||
|
return cs
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestTheNodeEnginesTestsHaveTheControllerBesideThem(t *testing.T) {
|
||||||
|
const host = "novox/mesh-host"
|
||||||
|
b := newBench(t)
|
||||||
|
b.ex.Trunks = trunksOf(t, map[string]string{host: trunkA, controllerRepo: trunkA2, catalogueRepository: trunkS, SDKRepository: trunkS})
|
||||||
|
b.judge(t, hostCase(t, pullOf(host, 5, head1)))
|
||||||
|
if c := besideOf(t, b, host)[controllerRepo]; c.Commit != trunkA2 || c.Ref != "" {
|
||||||
|
t.Errorf("the controller beside the node-engine alone = %+v, want its trunk %s", c, trunkA2)
|
||||||
|
}
|
||||||
|
b = newBench(t)
|
||||||
|
b.ex.Trunks = trunksOf(t, map[string]string{host: trunkA, controllerRepo: trunkA2, catalogueRepository: trunkS, SDKRepository: trunkS})
|
||||||
|
b.ex.Forge = &fakeForge{goMods: map[string]string{controllerRepo + " go.mod " + head2: capturedGoMod(t, "cb54756c3865")},
|
||||||
|
onTrunk: map[string]bool{"cb54756c3865": true}}
|
||||||
|
b.judge(t, hostCase(t, pullOf(host, 5, head1), pullOf(controllerRepo, 9, head2)))
|
||||||
|
if c := besideOf(t, b, host)[controllerRepo]; c.Commit != head2 || c.Ref != "refs/pull/9/head" {
|
||||||
|
t.Errorf("the controller beside the node-engine in a group = %+v, want the member's head %s", c, head2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestThePinOfTheControllerThatCannotBeReadFailsTheCheck(t *testing.T) { // review D2
|
func TestThePinOfTheControllerThatCannotBeReadFailsTheCheck(t *testing.T) { // review D2
|
||||||
b := newBench(t)
|
b := newBench(t)
|
||||||
b.ex.Trunks = trunksOf(t, map[string]string{"novox/mesh-controller": trunkA})
|
b.ex.Trunks = trunksOf(t, map[string]string{"novox/mesh-controller": trunkA})
|
||||||
|
|||||||
Reference in New Issue
Block a user