From 976633836880f74b064ed45319c76162c8f47547 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 8 Oct 2026 13:56:09 +0200 Subject: [PATCH] Build every artifact the forge declares in the forge tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catalogue's forge gained an npm-registry bundle (hq ADR 0251 §4), so resolving it against its code bundle alone failed three tests on main and on every pull request. --- .../catalogue/foundation_manifests_test.go | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/internal/catalogue/foundation_manifests_test.go b/internal/catalogue/foundation_manifests_test.go index a78fe472..2c94f9e6 100644 --- a/internal/catalogue/foundation_manifests_test.go +++ b/internal/catalogue/foundation_manifests_test.go @@ -177,19 +177,8 @@ func TestTheForgeHoldsTheNpmAndGitSeats(t *testing.T) { // wrong on every node whose assignment differs, and wrong for a second reason on a node given the // port (ADR 0100). Composed through the whole path, because what proves the placeholder resolves // in an `env` at all is a declaration, not a manifest. -// forgeBuilt is every artifact the forge's manifest builds: its code, and since hq ADR 0251 the npm -// registry it serves beside it. A manifest resolves only against all of what it asked to be built. -func forgeBuilt() []Built { - var out []Built - for _, name := range []string{"code", "npm-registry"} { - out = append(out, Built{Name: name, Kind: ArtifactBundle, - Reference: ArtifactStoreScheme + "gitea/" + name + "/blobs/" + bundleDigest, Digest: bundleDigest}) - } - return out -} - func TestTheForgesOwnAddressFollowsThePortTheNodeGaveIt(t *testing.T) { - forge, err := catalogueManifest(t, "gitea").Resolve(forgeBuilt()) + forge, err := catalogueManifest(t, "gitea").Resolve(forgeBuilt(catalogueManifest(t, "gitea"))) if err != nil { t.Fatalf("the forge's manifest does not resolve against its own build: %v", err) } @@ -242,7 +231,7 @@ func TestTheForgesOwnAddressFollowsThePortTheNodeGaveIt(t *testing.T) { func declaredGiteaSsh(t *testing.T, given map[int]int) map[string]any { t.Helper() forge := catalogueManifest(t, "gitea") - resolved, err := forge.Resolve(forgeBuilt()) + resolved, err := forge.Resolve(forgeBuilt(forge)) if err != nil { t.Fatalf("the forge's manifest does not resolve against its own build: %v", err) } @@ -314,3 +303,15 @@ func TestANodeMayGiveTheForgesSshPortADifferentNumber(t *testing.T) { t.Fatalf("the forge is published on %v, not the port this node gave it", server["ports"]) } } + +// forgeBuilt is a build of every artifact the forge's manifest declares: its code bundle and, since the +// catalogue added it (novox/hq ADR 0251 §4), its npm registry's. Named from the manifest, so a third +// artifact does not break every forge test again. +func forgeBuilt(forge Manifest) []Built { + var out []Built + for _, a := range forge.Build.Artifacts { + out = append(out, Built{Name: a.Name, Kind: ArtifactBundle, + Reference: ArtifactStoreScheme + "gitea/" + a.Name + "/blobs/" + bundleDigest, Digest: bundleDigest}) + } + return out +}