The builder adopts meshcatalogclient's branch follower on its views reader (A-5, A-15): the modules, their manifests (kept from the entry that holds them, by its digest), their packages and each package's name in its ecosystem are read from the catalog half's entries, never the indexer's modules, manifests, candidates and packages views; an entry of a branch other than the module's first builds its fingerprint and supersedes only its own branch's older one; the start's sweep runs once every followed half's first view is in; the builder's tools bundle reads package names through the same follower. A run's candidate is no input of the builder (A-84): its read of the indexer's candidates view goes, and the entry point for a run's build ask is not built (no line gives the ask's form). The seats' events the builder's own handler takes are named per seat so the follower's events have one taker. Builds: design 47 G §348, §479, §614, A-5, A-15, A-84 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog"
|
|
)
|
|
|
|
// TestTheManifestOfAnEntryIsReadByItsDigest: the builder reads a manifest from the entry that holds it, by the entry's manifest
|
|
// digest (design 47 G §348), and an entry with no manifest keeps none.
|
|
func TestTheManifestOfAnEntryIsReadByItsDigest(t *testing.T) {
|
|
m := &entryManifests{}
|
|
e := meshcatalog.CatalogEntry{Module: "netcheck", ManifestDigest: "sha256:aa", Manifest: map[string]any{"module": "netcheck", "version": "1"}}
|
|
if err := m.keep(e); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if mf, err := m.Manifest(context.Background(), "sha256:aa"); err != nil || mf.Module != "netcheck" {
|
|
t.Errorf("Manifest(sha256:aa) = %+v, %v", mf, err)
|
|
}
|
|
if _, err := m.Manifest(context.Background(), "sha256:bb"); err == nil {
|
|
t.Error("Manifest of a digest no entry holds: want an error")
|
|
}
|
|
if err := m.keep(meshcatalog.CatalogEntry{Module: "bare"}); err != nil || len(m.byFp) != 1 {
|
|
t.Errorf("an entry with no manifest kept one: %v, %v", err, m.byFp)
|
|
}
|
|
}
|