6b7ee4a98 added groupSink, groupFirstToken and groupPatience to settings
and to settingsapi.Keys. Two guards went red on main (#5644):
- TestSettingsSaveKeepsWhatItDoesNotSend wants every setting the Settings
page doesn't send set in the test and kept by POST /api/settings. Merge
already keeps the three (6b7ee4a98 added that); the test never set
them, so it couldn't check it. It sets them now (true, 30, 120), as it
does BusyLoad.
- TestSettingsCLISetsWhatTheWindowSaves wants every key `magpie settings`
sets to be one a page sends POST /api/settings. The Routing groups
page saves these three through POST /api/groups/defaults
(settings.SetGroupDefaults), and the page itself names `magpie
settings set` as the other way to set them. The CLI path is real, so
the keys stay in settingsapi.Keys. The test now has ownRoute: a key a
page saves through a route of its own, with the call and the body key
it sends it as, and it fails when no page's call sends that key any
more, or when ownRoute names a key the CLI can't set.
Siblings: 6b7ee4a98 added no other settings key. provider.Group's new
NoSink and FirstTokenWait have no CLI side to miss: `magpie group set`
has no sink, first-token or patience option before or after it.
Run on mote at origin/main f8525323d:
- Before the change, the two tests: red with the 3+3 lines of #5644.
After: ok.
- Broken by hand: Merge not keeping groupPatience made
TestSettingsSaveKeepsWhatItDoesNotSend red ("GroupPatience: 0 ... was
120"); client.js's groups/defaults call without patience made
TestSettingsCLISetsWhatTheWindowSaves red. Restored.
- Real CLI, a built magpie in a sandbox HOME: `settings set` groupPatience
120, groupSink true, groupFirstToken 45 were saved to settings.json and
listed; groupPatience 999 was refused with nothing changed.
- go test -tags nogui ./internal/cli ./internal/gui: ok.
- gofmt -l: clean. GOOS=linux go vet -tags nogui ./... and GOOS=windows
go vet ./...: clean.
Not run: the full suite and the GUI (Playwright) suite; no page script
changed.
Fixes#5644