diff --git a/go/catalogue/config_test.go b/go/catalogue/config_test.go index 1b70d64b..b8825344 100644 --- a/go/catalogue/config_test.go +++ b/go/catalogue/config_test.go @@ -136,7 +136,7 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { // The registry milestone's words round-trip the same (design 32): a config value's old name, an artifact's series // and contracts marker, the series a module accepts of a package; absent, a series is 0.1. - declared := []byte(`{"module":"c","version":"1","config":{"font":{"type":"string","renamed-from":"font-name"}}, + declared := []byte(`{"module":"c","version":"1","check-needs":["node-build-node"],"config":{"font":{"type":"string","renamed-from":"font-name"}}, "packages":{"mesh-sdk":"0.2"}, "build":{"artifacts":[{"name":"go","kind":"package","language":"go","paths":["go"],"series":"0.2", "generated-from":"seats","check-needs":["node-build-node"]},{"name":"lib","kind":"package","language":"typescript"}]}}`) @@ -148,7 +148,8 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { m.AcceptedSeries("mesh-contracts") != DefaultSeries || m.Build.Artifacts[0].SeriesOf() != "0.2" || m.AcceptedSeries("mesh-sdk", "0.1") != "0.2" || m.AcceptedSeries("mesh-contracts", "0.10", "x", "0.3", "1.0") != "0.3" || m.Build.Artifacts[0].GeneratedFrom != "seats" || m.Build.Artifacts[1].SeriesOf() != "0.1" || - !slices.Equal(m.Build.Artifacts[0].CheckNeeds, []string{"node-build-node"}) || m.Build.Artifacts[1].CheckNeeds != nil { + !slices.Equal(m.Build.Artifacts[0].CheckNeeds, []string{"node-build-node"}) || m.Build.Artifacts[1].CheckNeeds != nil || + !slices.Equal(m.CheckNeeds, []string{"node-build-node"}) { t.Fatalf("read %+v", m) } raw, _ = json.Marshal(m) @@ -158,6 +159,9 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { t.Errorf("written back without %s: %s", said, raw) } } + if strings.Count(string(raw), `"check-needs":["node-build-node"]`) != 2 { // H-A-453 (2): the module's own and the artifact's + t.Errorf("the module's check-needs is not written back: %s", raw) + } if strings.Count(string(raw), `"series"`) != 1 { t.Errorf("a series nobody said is written: %s", raw) } diff --git a/go/catalogue/manifest.go b/go/catalogue/manifest.go index ec2d485e..9c4d5855 100644 --- a/go/catalogue/manifest.go +++ b/go/catalogue/manifest.go @@ -746,6 +746,11 @@ type Manifest struct { // wrong the moment anybody edits anything. Build *Build `json:"build,omitempty"` + // CheckNeeds are the seats the integration tests of a package outside every artifact's `from` need the node to hold, by + // name, in an artifact's form (Artifact.CheckNeeds): the Go build module reads them for the packages no artifact's + // `from` holds (design 47 H2 H-A-453 (2)). Empty needs nothing. + CheckNeeds []string `json:"check-needs,omitempty"` + // Templates is the module's directory its template files are kept in, and its build packs into its templates // archive: files/ when it says none (DefaultTemplatesDir; novox/hq ADR 0349 ยง2, issue 731). A module whose files/ // is already an archive unpacked onto the machine names another, so its templates neither land beside what it