Keep a URL config value out of the boot error that rejects it
CI / full-gate (push) Failing after 1m6s

This commit is contained in:
2026-10-31 13:48:43 +01:00
parent 03bcf216a7
commit 217a36252e
7 changed files with 67 additions and 27 deletions
+10
View File
@@ -181,6 +181,16 @@ test("provisioning still runs with nothing to provision, so orphans are reported
assert.deepEqual(calls[0]?.pluginIds, []);
});
// The postgres driver rethrows a malformed DSN with the whole string on the error (`input`), so
// the URL is checked here, before the driver sees it.
test("a malformed PLUGIN_DB_ADMIN_URL is refused by name, never echoing the password", async () => {
const env = { PLUGIN_DB_ADMIN_URL: "postgres://admin:pa/ss@db:5432/plugins" };
await assert.rejects(
provisionPluginStorage(env, [storagePlugin("things")], SILENT, async () => ({ orphans: [], provisioned: [] })),
(err: Error) => err.message.includes("PLUGIN_DB_ADMIN_URL") && !err.message.includes("pa/ss"),
);
});
test("a plugin declaring storage without a provisioning DSN fails loud, naming the plugin", async () => {
const { calls, provision } = recordingProvisioner();
await assert.rejects(