Narrow the bar test to what the controller owns for a moved bar; rendering is issue 915 (issue 914)
mesh/merge-gate head c860426c555a merged into trunk a20680dfe769 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head c860426c555a merged into trunk a20680dfe769 — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/merge-gate head c860426c555a merged into trunk a20680dfe769 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head c860426c555a merged into trunk a20680dfe769 — pass: its merge-check.sh passed
mesh/delivery delivered
This commit is contained in:
@@ -157,22 +157,39 @@ func TestAPieceTheHolderCannotRenderIsLeftOutAndNamedNotTheMachine(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheCataloguesBarRendersEveryExampleOfTheShape(t *testing.T) {
|
||||
// A moved bar is rendered by the provisioner's client, not by the controller, so the rule that its template renders
|
||||
// every example of the shape is no longer judged here (issue 915, which also covers placementProblems not reading the
|
||||
// collected form). What the controller still owns is that the bar's files place the blocks at all: a moved bar's
|
||||
// carry the collected placement, and one that stopped placing them fails here rather than being skipped (issue 432).
|
||||
func TestTheCataloguesBarPlacesBlocksAndItsShapeCoversEveryShow(t *testing.T) {
|
||||
holder := catalogueManifest(t, "i3status-rust")
|
||||
s, _ := SeatNamed(BarSeat)
|
||||
if !placesKind(holder, s, BarKindBlock) {
|
||||
// It places them since the catalogue's bar took the seat; a skip here hid a bar that stopped
|
||||
// (novox/hq issue 432).
|
||||
t.Fatal("the catalogue's bar places no blocks, so none of the shape's examples would render")
|
||||
}
|
||||
tmpl, err := holderTemplate(holder, s, BarKindBlock)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, ex := range s.Receives[0].Shape.Examples {
|
||||
out, err := renderPiece(tmpl, "example", "a-machine", ex)
|
||||
if err != nil || !strings.Contains(out, "[[block]]") {
|
||||
t.Errorf("the catalogue's bar renders %v as %q: %v", ex, out, err)
|
||||
if holder.Moved {
|
||||
placed := "${collected:contribution:" + BarSeat + ":" + BarKindBlock + ":"
|
||||
found := false
|
||||
for _, res := range holder.Resources {
|
||||
if content, _ := res["content"].(string); strings.Contains(content, placed) {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatalf("the catalogue's moved bar places no blocks: none of its files carries %s…}", placed)
|
||||
}
|
||||
} else {
|
||||
if !placesKind(holder, s, BarKindBlock) {
|
||||
// It places them since the catalogue's bar took the seat; a skip here hid a bar that stopped
|
||||
// (novox/hq issue 432).
|
||||
t.Fatal("the catalogue's bar places no blocks, so none of the shape's examples would render")
|
||||
}
|
||||
tmpl, err := holderTemplate(holder, s, BarKindBlock)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, ex := range s.Receives[0].Shape.Examples {
|
||||
out, err := renderPiece(tmpl, "example", "a-machine", ex)
|
||||
if err != nil || !strings.Contains(out, "[[block]]") {
|
||||
t.Errorf("the catalogue's bar renders %v as %q: %v", ex, out, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for shows := range barShows {
|
||||
|
||||
Reference in New Issue
Block a user