feat: add AI catalog description generation
This commit is contained in:
@@ -169,3 +169,23 @@ test("connects pg through OpenSSH, supplies askpass, and releases all secret lea
|
||||
expect(child.kill).toHaveBeenCalledWith("SIGTERM");
|
||||
expect(leasedPaths.some(existsSync)).toBe(false);
|
||||
});
|
||||
|
||||
test("fails before creating a transport when the sampling signal is already aborted", async () => {
|
||||
const store = secretStore();
|
||||
store.putMany("psd-clinical", {
|
||||
[CATALOG_SECRET_IDS.password]: "db-password",
|
||||
[CATALOG_SECRET_IDS.sshPrivateKey]: "PRIVATE KEY\n",
|
||||
[CATALOG_SECRET_IDS.sshKnownHosts]: "bastion.internal ssh-ed25519 AAAATEST\n",
|
||||
});
|
||||
const spawnSsh = vi.fn(() => fakeChild());
|
||||
const createClient = vi.fn();
|
||||
const access = new ConcreteCatalogPostgresAccess(store, { spawnSsh, createClient });
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
|
||||
await expect(access.connect(sshDatabase(), controller.signal)).rejects.toThrow(
|
||||
"PostgreSQL connector aborted",
|
||||
);
|
||||
expect(spawnSsh).not.toHaveBeenCalled();
|
||||
expect(createClient).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user