Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: consume role SQL in the database setup fixture (#10572)

[._.]/9747006e1364
diff --git a/scripts/db-migrate.test.js b/scripts/db-migrate.test.js
index 248a5953f1..bbc4469135 100644
--- a/scripts/db-migrate.test.js
+++ b/scripts/db-migrate.test.js
@@ -46,6 +46,7 @@ const PSQL_STUB = `#!/bin/sh
echo "psql $*" >> "$STUB_LOG"
echo "endpoint-env \${PGHOSTADDR-unset}|\${PGSERVICE-unset}|\${PGSERVICEFILE-unset}|\${PGOPTIONS-unset}" >> "$STUB_LOG"
case "$*" in *--single-transaction*) cat >> "$IMPORT_LOG"; exit "\${IMPORT_EXIT:-0}" ;; esac
+if [ -n "\${PORTOS_BOOTSTRAP_ROLE:-}" ]; then cat > "$ROLE_INPUT_LOG"; fi
case "$*" in *count*) echo 3 ;; esac
exit 0
`;
@@ -124,6 +125,7 @@ describe.skipIf(process.platform === 'win32')('scripts/db.sh export + migrate',
HOME: root,
STUB_LOG: stubLog,
IMPORT_LOG: importLog,
+ ROLE_INPUT_LOG: join(root, 'role.sql'),
DUMP_MODE: dumpMode,
FULL_DUMP,
PGPASSWORD: 'test-only',
@@ -389,6 +391,7 @@ describe.skipIf(process.platform === 'win32')('scripts/db.sh export + migrate',
expect(result.status).toBe(0);
expect(psqlCalls().length).toBeGreaterThanOrEqual(6);
expect(psqlCalls().every(call => call.includes('-p 5433 '))).toBe(true);
+ expect(readFileSync(join(root, 'role.sql'), 'utf8')).toContain('CREATE ROLE :"role"');
});
it('fails without issuing SQL to another cluster when the selected endpoint is down', () => {