Compare commits

...

1 Commits

Author SHA1 Message Date
xingyue aab846498b fix: fix 7 failing tests (OCAS_DIR → OCAS_HOME + restore workflow destructure)
CI / check (pull_request) Failing after 55s
Root cause: tests used OCAS_DIR env var but store.ts reads OCAS_HOME,
causing tests to hit the global ~/.ocas vars instead of temp dirs.

- store-unified-threads.test.ts: OCAS_DIR → OCAS_HOME (3 tests)
- thread-resume.test.ts: OCAS_DIR → OCAS_HOME (3 tests)
- current-role.test.ts: restore { thread, workflow } destructure
  that was incorrectly removed by biome unsafe fix (1 test)

Result: 745 passed, 0 failed, 1 skipped

Closes #49
2026-06-04 17:51:21 +08:00
3 changed files with 5 additions and 5 deletions
@@ -324,7 +324,7 @@ describe("currentRole field", () => {
try { try {
const wf = join(tmpDir, "test-current-role.yaml"); const wf = join(tmpDir, "test-current-role.yaml");
await writeFile(wf, SIMPLE_WORKFLOW_YAML, "utf8"); await writeFile(wf, SIMPLE_WORKFLOW_YAML, "utf8");
const { thread } = await cmdThreadStart(storageRoot, wf, "test", tmpDir); const { thread, workflow } = await cmdThreadStart(storageRoot, wf, "test", tmpDir);
const tid = thread as ThreadId; const tid = thread as ThreadId;
await createMarker(storageRoot, { await createMarker(storageRoot, {
@@ -15,7 +15,7 @@ import {
async function makeUwfStore(storageRoot: string) { async function makeUwfStore(storageRoot: string) {
const casDir = join(storageRoot, "cas"); const casDir = join(storageRoot, "cas");
await mkdir(casDir, { recursive: true }); await mkdir(casDir, { recursive: true });
process.env.OCAS_DIR = casDir; process.env.OCAS_HOME = casDir;
return createUwfStore(storageRoot); return createUwfStore(storageRoot);
} }
@@ -491,7 +491,7 @@ describe("uwf thread resume - completed threads", () => {
cwd: tmpDir, cwd: tmpDir,
}); });
process.env.OCAS_DIR = casDir; process.env.OCAS_HOME = casDir;
const workerOutputHash = await store.cas.put(outputSchemaHash, { $status: "_" }); const workerOutputHash = await store.cas.put(outputSchemaHash, { $status: "_" });
const reviewerOutputHash = await store.cas.put(outputSchemaHash, { $status: "_" }); const reviewerOutputHash = await store.cas.put(outputSchemaHash, { $status: "_" });
@@ -654,7 +654,7 @@ echo '${adapterJson}'
cwd: tmpDir, cwd: tmpDir,
}); });
process.env.OCAS_DIR = casDir; process.env.OCAS_HOME = casDir;
await seedThreads(tmpDir, { await seedThreads(tmpDir, {
[THREAD_ID]: { [THREAD_ID]: {
head: startHash, head: startHash,
@@ -702,7 +702,7 @@ echo '${adapterJson}'
cwd: tmpDir, cwd: tmpDir,
}); });
process.env.OCAS_DIR = casDir; process.env.OCAS_HOME = casDir;
await seedThreads(tmpDir, { [THREAD_ID]: startHash }); await seedThreads(tmpDir, { [THREAD_ID]: startHash });
const result = runUwf(["thread", "resume", THREAD_ID], casDir); const result = runUwf(["thread", "resume", THREAD_ID], casDir);