S10 check-needs: a Go artifact declares what its tests need in its manifest
catalogue.Artifact gains check-needs (node-modules), the field that replaces the marker file in a package's directory; its readers read it from the manifest. Builds: design 47 H2 §800; H-A-350 DMC-6
This commit is contained in:
@@ -138,7 +138,7 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) {
|
||||
declared := []byte(`{"module":"c","version":"1","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"},{"name":"lib","kind":"package","language":"typescript"}]}}`)
|
||||
"generated-from":"seats","check-needs":"node-modules"},{"name":"lib","kind":"package","language":"typescript"}]}}`)
|
||||
m, err = decodeForTest(declared)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -146,12 +146,13 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) {
|
||||
if m.Settings["font"].RenamedFrom != "font-name" || m.AcceptedSeries("mesh-sdk") != "0.2" ||
|
||||
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" {
|
||||
m.Build.Artifacts[0].GeneratedFrom != "seats" || m.Build.Artifacts[1].SeriesOf() != "0.1" ||
|
||||
m.Build.Artifacts[0].CheckNeeds != "node-modules" || m.Build.Artifacts[1].CheckNeeds != "" {
|
||||
t.Fatalf("read %+v", m)
|
||||
}
|
||||
raw, _ = json.Marshal(m)
|
||||
for _, said := range []string{`"renamed-from":"font-name"`, `"packages":{"mesh-sdk":"0.2"}`, `"series":"0.2"`,
|
||||
`"generated-from":"seats"`} {
|
||||
`"generated-from":"seats"`, `"check-needs":"node-modules"`} {
|
||||
if !strings.Contains(string(raw), said) {
|
||||
t.Errorf("written back without %s: %s", said, raw)
|
||||
}
|
||||
|
||||
@@ -1263,6 +1263,12 @@ type Artifact struct {
|
||||
// module carrying it holds contracts only and claims no seat, which the judge refuses naming the seat; the build
|
||||
// modules' test step regenerates the package and fails on a file out of step.
|
||||
GeneratedFrom string `json:"generated-from,omitempty"`
|
||||
|
||||
// CheckNeeds is what a Go artifact's tests need beside its Go toolchain: `node-modules`, the module's npm tree,
|
||||
// which the pipeline runner has the seat node-build-node install before the integration level (design 47 H2 §800;
|
||||
// H-A-350 DMC-6). It replaces the marker file check-needs in a package's directory; the Go build module's digest and
|
||||
// the delivery SDK's step run read it here. Empty needs nothing more.
|
||||
CheckNeeds string `json:"check-needs,omitempty"`
|
||||
}
|
||||
|
||||
// AcceptedSeries is the series of the package of that name this module accepts: the one Packages names, or else the
|
||||
|
||||
Reference in New Issue
Block a user