H-21: the manifest invokes revision (none-yet) and withheld, and config view-waits-minutes
The long-form invokes entry is read by mesh-sdk's second reader release (09d6070e): packaging's manifest tests pass with it placed and fail before it is joined. Builds: design 47 G §558, §617, §633, §635
This commit is contained in:
@@ -3,6 +3,7 @@ package packaging_test
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -62,7 +63,7 @@ func TestTheManifestConsumesTheBackupEvent(t *testing.T) {
|
||||
}
|
||||
var m struct {
|
||||
Consumes []string `json:"consumes"`
|
||||
Invokes []string `json:"invokes"`
|
||||
Invokes []any `json:"invokes"` // a verb, or the long form {verb, fields} (§558)
|
||||
Config map[string]struct {
|
||||
Default any `json:"default"`
|
||||
} `json:"config"`
|
||||
@@ -71,11 +72,16 @@ func TestTheManifestConsumesTheBackupEvent(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Design 47 G §630, §633, A-77: the recovery module's three verbs it asks, and its bound as a config key of 90.
|
||||
for _, v := range []string{"seat:mesh-recovery.kept-points", "seat:mesh-recovery.restore-kept", "seat:mesh-recovery.snapshot-kept"} {
|
||||
if !slices.Contains(m.Invokes, v) {
|
||||
t.Errorf("invokes %v lacks %s", m.Invokes, v)
|
||||
// §635, §558, §617: it invokes `withheld` and names no `uses`; the catalog's revision in the long form with the field none-yet.
|
||||
for _, v := range []any{"seat:mesh-recovery.kept-points", "seat:mesh-recovery.restore-kept", "seat:mesh-recovery.snapshot-kept",
|
||||
"seat:mesh-grants.withheld", map[string]any{"verb": "seat:mesh-catalog.revision", "fields": []any{"none-yet"}}} {
|
||||
if !slices.ContainsFunc(m.Invokes, func(have any) bool { return reflect.DeepEqual(have, v) }) {
|
||||
t.Errorf("invokes %v lacks %v", m.Invokes, v)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(string(raw), `"content": "${config:view-waits-minutes}\n"`) || m.Config["view-waits-minutes"].Default != float64(5) {
|
||||
t.Errorf("module.json declares no file with the content ${config:view-waits-minutes} or its default is not 5 (§633)")
|
||||
}
|
||||
if !strings.Contains(string(raw), `"content": "${config:recovery-wait-minutes}\n"`) {
|
||||
t.Errorf("module.json declares no file with the content ${config:recovery-wait-minutes} (design 47 G A-112)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user