Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assistant/src/__tests__/test-preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { join } from "node:path";
import { afterAll } from "bun:test";

import { resetDb } from "../memory/db-connection.js";
import { _setStorePath } from "../security/encrypted-store.js";

const testDir = realpathSync(
mkdtempSync(join(tmpdir(), "vellum-test-workspace-")),
Expand All @@ -25,6 +26,11 @@ process.env.VELLUM_WORKSPACE_DIR = testDir;
process.env.VELLUM_PLATFORM_URL = "https://test-platform.vellum.ai";
process.exitCode = 0;

// Isolate the encrypted credential store per test file. Without this,
// parallel test processes all read/write the same ~/.vellum/protected/keys.enc,
// causing races when one file deletes a key while another sets it.
_setStorePath(join(testDir, "keys.enc"));

// Force-close any DB connection inherited from the parent process (e.g. when
// the test runner is spawned by the running assistant via a pre-push hook).
// Without this, the db singleton in db-connection.ts may still point at the
Expand Down
Loading