S10 check-needs names the seats a package's tests need the node to hold
check-needs is a list of seat names (node-build-node), as the marker file named them, not the value node-modules. Builds: design 47 H2 §800; H-A-350 DMC-6, H-A-399 (3)
This commit is contained in:
@@ -3,6 +3,7 @@ package catalogue
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -138,7 +139,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","check-needs":"node-modules"},{"name":"lib","kind":"package","language":"typescript"}]}}`)
|
||||
"generated-from":"seats","check-needs":["node-build-node"]},{"name":"lib","kind":"package","language":"typescript"}]}}`)
|
||||
m, err = decodeForTest(declared)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -147,12 +148,12 @@ 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" ||
|
||||
m.Build.Artifacts[0].CheckNeeds != "node-modules" || m.Build.Artifacts[1].CheckNeeds != "" {
|
||||
!slices.Equal(m.Build.Artifacts[0].CheckNeeds, []string{"node-build-node"}) || m.Build.Artifacts[1].CheckNeeds != nil {
|
||||
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"`, `"check-needs":"node-modules"`} {
|
||||
`"generated-from":"seats"`, `"check-needs":["node-build-node"]`} {
|
||||
if !strings.Contains(string(raw), said) {
|
||||
t.Errorf("written back without %s: %s", said, raw)
|
||||
}
|
||||
|
||||
@@ -1285,11 +1285,10 @@ type Artifact struct {
|
||||
// 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"`
|
||||
// CheckNeeds are the seats a Go artifact's integration tests need the node to hold, by name (`node-build-node`), as the
|
||||
// marker file check-needs in a package's directory named them, which this field replaces (design 47 H2 §800; H-A-350
|
||||
// DMC-6, H-A-399 (3)); the Go build module's digest and the delivery SDK's step run read it here. Empty needs nothing.
|
||||
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