row 175 (#1673): scripts/mosaic sends plugins, name, names, follow, threads and thread to packages/cli (sage-1081); the tester gate test sends bad keys to organization.set and organization.revision
This commit is contained in:
1 parent
c0b06ed89b
commit
3067ae93ea
3 files changed
+24
-1
No files matched your search
@@ -124,6 +124,9 @@ test('row 175: the human-only actions refuse a tester tester-refused, and the fi
|
|||||||
['organization.set', { revision, limits: { total: 0 } }],
|
['organization.set', { revision, limits: { total: 0 } }],
|
||||||
['routes', {}],
|
['routes', {}],
|
||||||
['organization.revision', {}],
|
['organization.revision', {}],
|
||||||
|
// The gate runs before the argument checks: a bad key still refuses tester-refused.
|
||||||
|
['organization.set', { revision, nope: 1 }],
|
||||||
|
['organization.revision', { nope: 1 }],
|
||||||
['decision.resolve', { id: 'd-1', choice: 'yes' }],
|
['decision.resolve', { id: 'd-1', choice: 'yes' }],
|
||||||
['launch.revoke', {}],
|
['launch.revoke', {}],
|
||||||
['launch.restore', {}],
|
['launch.restore', {}],
|
||||||
|
|||||||
@@ -127,6 +127,26 @@ function mosaic(args, env) {
|
|||||||
child.on("close", (status) => resolve({ status, out, err }));
|
child.on("close", (status) => resolve({ status, out, err }));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// sage-1081: these six fell through to the seat CLI, which refused with its own usage, so W1
|
||||||
|
// (`plugins set`) and W4 (`name`) failed through the wrapper. Each now reaches packages/cli.
|
||||||
|
test("row 175: scripts/mosaic sends plugins, name, names, follow, threads and thread to packages/cli, not the seat CLI", (t) => {
|
||||||
|
const root = tmp(t, "mosaic-cli-route-");
|
||||||
|
const env = { PATH: process.env.PATH, HOME: join(root, "home"), MOSAIC_CONFIG: join(root, "none.json") };
|
||||||
|
for (const [args, message] of [
|
||||||
|
[["plugins", "x"], /^mosaic: mosaic plugins \[--business ID\]/],
|
||||||
|
[["name"], /^mosaic: name takes an instance and a name\n/],
|
||||||
|
[["names", "x"], /^mosaic: names takes no arguments\n/],
|
||||||
|
[["follow", "x"], /^mosaic: follow takes no arguments\n/],
|
||||||
|
[["threads", "x"], /^mosaic: threads takes no arguments\n/],
|
||||||
|
[["thread"], /^mosaic: usage:\n mosaic thread create /],
|
||||||
|
]) {
|
||||||
|
const r = spawnSync(MOSAIC, args, { env, encoding: "utf8" });
|
||||||
|
assert.equal(r.status, 4, args.join(" "));
|
||||||
|
assert.match(r.stderr, message, args.join(" "));
|
||||||
|
assert.doesNotMatch(r.stderr, /mosaic launch </, args.join(" "));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const listing = (dir) => readdirSync(dir, { recursive: true }).map(String).sort();
|
const listing = (dir) => readdirSync(dir, { recursive: true }).map(String).sort();
|
||||||
async function w7(t, vars, edit) {
|
async function w7(t, vars, edit) {
|
||||||
const root = tmp(t, "mosaic-cli-tester-init-");
|
const root = tmp(t, "mosaic-cli-tester-init-");
|
||||||
|
|||||||
+1
-1
@@ -35,6 +35,6 @@ if [ "${1:-}" = business ]; then
|
|||||||
exec node "$REPO/packages/business/src/cli.mjs" "$@"
|
exec node "$REPO/packages/business/src/cli.mjs" "$@"
|
||||||
fi
|
fi
|
||||||
case "${1:-}" in
|
case "${1:-}" in
|
||||||
usage|project|limits|inbox|decide|tasks|agents|trail|talk|stop|launches|bus) exec node "$REPO/packages/cli/src/cli.mjs" "$@" ;;
|
usage|project|limits|inbox|decide|tasks|agents|trail|talk|stop|launches|bus|plugins|name|names|follow|threads|thread) exec node "$REPO/packages/cli/src/cli.mjs" "$@" ;;
|
||||||
esac
|
esac
|
||||||
exec node "$REPO/packages/seat/src/cli.mjs" "$@"
|
exec node "$REPO/packages/seat/src/cli.mjs" "$@"
|
||||||
Reference in new issue
Block a user