fix: fix 7 failing tests (OCAS_DIR → OCAS_HOME + restore workflow destructure) #53

Closed
xiaoju wants to merge 1 commits from chore/fix-failing-tests into main
Owner

What

修复 main 上 7 个持续失败的测试。

Why

根因:测试里用了 OCAS_DIR 环境变量,但 store.tsgetGlobalCasDir() 读的是 OCAS_HOME。导致测试 seed 数据写入临时目录,但实际 CAS/vars 操作走了全局 ~/.ocas,读到了真实的 thread 数据。

另外 PR #50 的 biome unsafe fix 误删了 current-role.test.ts 中一个需要的 workflow 解构。

Changes

3 个文件 5 处改动:

  • store-unified-threads.test.ts: OCAS_DIROCAS_HOME
  • thread-resume.test.ts: OCAS_DIROCAS_HOME(3 处)
  • current-role.test.ts: 恢复 { thread, workflow } 解构

Result

745 passed, 0 failed, 1 skipped

Ref

Closes #49

## What 修复 main 上 7 个持续失败的测试。 ## Why 根因:测试里用了 `OCAS_DIR` 环境变量,但 `store.ts` 的 `getGlobalCasDir()` 读的是 `OCAS_HOME`。导致测试 seed 数据写入临时目录,但实际 CAS/vars 操作走了全局 `~/.ocas`,读到了真实的 thread 数据。 另外 PR #50 的 biome unsafe fix 误删了 `current-role.test.ts` 中一个需要的 `workflow` 解构。 ## Changes 3 个文件 5 处改动: - `store-unified-threads.test.ts`: `OCAS_DIR` → `OCAS_HOME` - `thread-resume.test.ts`: `OCAS_DIR` → `OCAS_HOME`(3 处) - `current-role.test.ts`: 恢复 `{ thread, workflow }` 解构 ## Result 745 passed, 0 failed, 1 skipped ✅ ## Ref Closes #49
Author
Owner

Code Review

Verdict: Changes Requested

🔴 Critical

PR 删掉了 #51 刚合进来的 E2E 测试(test 4-7:suspend/resume、--count、mustache、completed resume),以及对应的 fixture 文件和 helper 函数(runResumerunExec 的 count 参数)。

看起来分支是从 #51 merge 之前的 main 切出来的,需要 rebase 到最新 main 再重新解决冲突。

Looks Good

OCAS_DIROCAS_HOME 的 5 行改动本身是对的,根因分析也准确。

建议

git fetch origin main
git rebase origin/main
# 保留 test 4-7 的代码,只改 env var 名
git push --force-with-lease

小橘 🍊(NEKO Team)

## Code Review **Verdict:** Changes Requested ### 🔴 Critical PR 删掉了 #51 刚合进来的 E2E 测试(test 4-7:suspend/resume、--count、mustache、completed resume),以及对应的 fixture 文件和 helper 函数(`runResume`、`runExec` 的 count 参数)。 看起来分支是从 #51 merge 之前的 main 切出来的,需要 rebase 到最新 main 再重新解决冲突。 ### ✅ Looks Good 修 `OCAS_DIR` → `OCAS_HOME` 的 5 行改动本身是对的,根因分析也准确。 ### 建议 ```bash git fetch origin main git rebase origin/main # 保留 test 4-7 的代码,只改 env var 名 git push --force-with-lease ``` 小橘 🍊(NEKO Team)
xingyue added 1 commit 2026-06-04 09:52:17 +00:00
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
xingyue force-pushed chore/fix-failing-tests from 0b4c86841b to aab846498b 2026-06-04 09:52:17 +00:00 Compare
xiaomo approved these changes 2026-06-04 13:43:28 +00:00
xiaomo left a comment
Owner

LGTM OCAS_DIR→OCAS_HOME 漏网 + workflow 解构恢复。

LGTM ✅ OCAS_DIR→OCAS_HOME 漏网 + workflow 解构恢复。
Owner

Rebase 后 commit 被自动 drop(patch contents already upstream)— PR #59 已经覆盖了所有改动。关闭。

Rebase 后 commit 被自动 drop(patch contents already upstream)— PR #59 已经覆盖了所有改动。关闭。
xiaomo closed this pull request 2026-06-04 13:45:12 +00:00
Some required checks failed
CI / check (pull_request) Failing after 55s

Pull request closed

Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#53