Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(e2e): guard-definer case 16 uses the connection's owner role, not a hardcoded 'postgres' (absent in CI)

garrytan95c3bc71627b
diff --git a/test/e2e/guard-definer-postgres.test.ts b/test/e2e/guard-definer-postgres.test.ts
index 4e2755479e..8a3ffa7043 100644
--- a/test/e2e/guard-definer-postgres.test.ts
+++ b/test/e2e/guard-definer-postgres.test.ts
@@ -511,7 +511,8 @@ describeE2E('purge and withdrawal guards under a scoped write role (#7632)', ()
EXECUTE format('CREATE POLICY gbrain_test_reader ON %s TO ${reader} USING (true) WITH CHECK (true)', t.rel);
END LOOP; END $$`);
const [held, heldOutput] = insertDerivation(JSON.stringify({ text: PURGED_CLAIM }));
- for (const role of ['postgres', bypass, reader]) {
+ const [{ owner }] = await conn.unsafe<Array<{ owner: string }>>('SELECT current_user AS owner');
+ for (const role of [owner!, bypass, reader]) {
await as(conn, role, async run => {
expect({ role, rows: rowsOf(await run(held, [ids.derived, 1, heldOutput])) }).toEqual({ role, rows: [] });
});