Take the removed release 6 verbs out of the schema test's flag checks

This commit is contained in:
2026-10-24 16:55:25 +02:00
parent aee0a2718f
commit 0f8c47842a
3 changed files with 13 additions and 16 deletions
+6
View File
@@ -100,6 +100,12 @@ type verbArguments struct {
var removedVerbs = map[string]bool{"build": true, "rebuild": true, "forget-checks": true, "delivery-plan": true,
"delivery-check": true, "queue": true, "cancel": true, "clear": true, "kill": true, "replay": true, "pause": true, "resume": true}
// removedVerb says a verb is one the seat answers by name only: removed in release 4e or in release 6.
func removedVerb(name string) bool {
_, r6 := removedInRelease6(name)
return removedVerbs[name] || r6
}
// removedInRelease6 says a verb is one release 6 removed (ADR 0539, ADR 0429 §8): refused by name, with its replacement.
func removedInRelease6(verb string) (string, bool) {
why, removed := catalogue.RemovedControllerVerbs[verb]
@@ -38,7 +38,7 @@ func servedSchemas(t *testing.T) map[string]catalogue.Verb {
func TestNoArgumentAVerbIsGivenIsPassedOver(t *testing.T) {
for name, v := range servedSchemas(t) {
if inProcess[name] || removedVerbs[name] {
if inProcess[name] || removedVerb(name) {
continue
}
names, switches := declaredArguments(v)
@@ -79,7 +79,7 @@ func TestAnArgumentAVerbDoesNotDeclareIsRefused(t *testing.T) {
args := sampleArguments(v)
args[stranger] = "x"
_, err := argvFor(name, args)
if inProcess[name] || removedVerbs[name] {
if inProcess[name] || removedVerb(name) {
_, err = readArguments(name, args)
}
if err == nil || !strings.Contains(err.Error(), strconv.Quote(stranger)) {
@@ -100,13 +100,13 @@ func TestAnArgumentAVerbDoesNotDeclareIsRefused(t *testing.T) {
func TestEveryFlagOfAVerbsCommandIsAnArgumentOrAccountedFor(t *testing.T) {
flags := commandFlags(t)
if len(flags["push"]) == 0 || len(flags["plan"]) == 0 {
t.Fatalf("reading the commands' flags found nothing for push or plan: %v", flags)
if len(flags["settings"]) == 0 || len(flags["upgrade"]) == 0 {
t.Fatalf("reading the commands' flags found nothing for settings or upgrade: %v", flags)
}
reached := map[string]map[string]bool{} // verb → flag sets its command lines reach
served := servedSchemas(t)
for name, v := range served {
if inProcess[name] || removedVerbs[name] || name == "command" {
if inProcess[name] || removedVerb(name) || name == "command" {
continue
}
names, switches := declaredArguments(v)
+2 -11
View File
@@ -148,19 +148,10 @@ func stringLit(e ast.Expr) (string, bool) {
var accountedFlags = map[string]map[string]string{
"status": {"json": "set by the verb: the answer is data"},
"seats": {"json": "set by the verb: the answer is data"},
"plan": {"json": "set by the verb unless files is asked"},
"push": {
"wait": "set by the verb to 0: a tool call cannot hold a connection for a whole apply",
"all": "withheld: the verb naming no machine is --behind, and a push of every machine is said at a " +
"shell (novox/hq ADR 0217); `command` reaches it",
},
"builds": {"n": "=limit"},
"plans": {"n": "=limit", "what-if": "=repository"},
// The machine's tunnel key, named as the verb's other arguments are (novox/hq ADR 0169).
"durations": {
"json": "set by the verb: the answer is data",
"all": "withheld: every measurement of a fortnight is more than a call should carry; `command` reaches it",
},
// `upgrade` takes --together, which only a roll-out of one machine first once meant; no caller reaches it.
"upgrade": {"together": "withheld: nothing rolls out one machine first any more (ADR 0539 §5); `command` reaches it"},
// The desk path of `secret accept` (novox/hq ADR 0259 §10): a value is never an argument of a call.
"hand-acts": {"json": "set by the verb: the answer is data"},
"conditions": {"json": "set by the verb: the answer is data"},