Carry the source fingerprint in the builds list, so builds can say it (issue 1208)
mesh/merge-gate head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/merge-gate head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: its merge-check.sh passed
mesh/delivery delivered
Issue 1204's line never showed: chainBuildList copied each build field by field and left the fingerprint out.
This commit is contained in:
@@ -256,3 +256,33 @@ func TestAFailedNewerBuildLeavesTheBuildSourceStale(t *testing.T) {
|
||||
t.Fatalf("after a newer failed build the proxy reads as %+v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// novox/hq issue 1208: the list builds reads carries each build's source fingerprint, so the verb can say it.
|
||||
func TestTheBuildsListCarriesTheSourceFingerprint(t *testing.T) {
|
||||
inv := fresh(t)
|
||||
ctx := context.Background()
|
||||
pinned := aBuild("1", "shell", "")
|
||||
pinned.SourceFingerprint = "src1:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
||||
if err := inv.RecordBuild(ctx, pinned); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := inv.RecordBuild(ctx, aBuild("2", "other", "")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, err := inv.Builds(ctx, "", 10)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
says := map[string]string{}
|
||||
for _, b := range got {
|
||||
says[b.Module] = b.SourceFingerprint
|
||||
}
|
||||
// 1208/AC1
|
||||
if says["shell"] != pinned.SourceFingerprint {
|
||||
t.Errorf("the list says %q for shell; want %q", says["shell"], pinned.SourceFingerprint)
|
||||
}
|
||||
// 1208/AC2
|
||||
if fp, listed := says["other"]; !listed || fp != "" {
|
||||
t.Errorf("a build with no fingerprint is listed with %q (listed %v); want it listed with none", fp, listed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user