morgana: row 295 r2 first-run reds placed (mos-1272): claim rows spread off the store's null prototype in access-revoke and thread-revoke, demo switches the pi harness on for startBroker, Alice binds at her first call in thread-revoke
This commit is contained in:
1 parent
b16cef1d0b
commit
9f29e1b2fd
2 files changed
+7
-6
No files matched your search
@@ -21,7 +21,7 @@ const grant = (over = {}) => ({
|
||||
});
|
||||
const BUSINESSES = {
|
||||
demo: {
|
||||
id: 'demo', human: 'jason', arbiters: { technical: 'chief', delivery: 'chief' }, vars: { 'bus.tester': true },
|
||||
id: 'demo', human: 'jason', arbiters: { technical: 'chief', delivery: 'chief' }, vars: { 'bus.tester': true }, plugins: { harness: ['pi'] },
|
||||
roles: {
|
||||
chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } },
|
||||
assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } },
|
||||
@@ -74,8 +74,8 @@ function setup(t, { runs = true, grants = [grant(), grant({ user: 'bob' })] } =
|
||||
caps[name] = b.bindLaunch(record(name, thread));
|
||||
return call(name, 'role.claim');
|
||||
};
|
||||
// The latest claim row of a run: its op, reason and by.
|
||||
const claim = (run) => store.get('SELECT op, reason, by FROM thread_claims WHERE holder_run=? ORDER BY seq DESC LIMIT 1', run);
|
||||
// The latest claim row of a run: its op, reason and by, spread off the store's null prototype.
|
||||
const claim = (run) => ({ ...store.get('SELECT op, reason, by FROM thread_claims WHERE holder_run=? ORDER BY seq DESC LIMIT 1', run) });
|
||||
const P = call('human', 'project.create', { name: 'shared' }).id;
|
||||
caps.alice = b.bindUser({ business: 'demo', user: 'alice' });
|
||||
caps.bob = b.bindUser({ business: 'demo', user: 'bob' });
|
||||
|
||||
@@ -141,9 +141,10 @@ async function start(t, { f, adapter, access }) {
|
||||
t.after(close);
|
||||
await launcher.listen();
|
||||
const human = runtime.broker.bindHuman({ business: "acme", human: f.doc.human, via: "cli", outsideAgent: true });
|
||||
const alice = runtime.broker.bindUser({ business: "acme", user: "alice" });
|
||||
// Alice binds at her first call: after the hand edit her bind refuses access-revoked.
|
||||
let alice = null;
|
||||
const call = (verb, args = {}) => runtime.broker.request(human, { verb, args });
|
||||
const as = (verb, args = {}) => runtime.broker.request(alice, { verb, args });
|
||||
const as = (verb, args = {}) => runtime.broker.request((alice ??= runtime.broker.bindUser({ business: "acme", user: "alice" })), { verb, args });
|
||||
return { runtime, launcher, call, as, logs, close };
|
||||
}
|
||||
|
||||
@@ -205,7 +206,7 @@ test("REQ-LAUNCH-1 R4: a running thread's run gets SIGTERM at the first tick aft
|
||||
const store = new Store(f.dataRoot);
|
||||
t.after(() => store.close());
|
||||
assert.deepEqual(
|
||||
store.get("SELECT op, reason, by FROM thread_claims WHERE holder_run=? ORDER BY seq DESC LIMIT 1", launch.run),
|
||||
{ ...store.get("SELECT op, reason, by FROM thread_claims WHERE holder_run=? ORDER BY seq DESC LIMIT 1", launch.run) },
|
||||
{ op: "revoke", reason: "access-revoked", by: "access-change" },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user