Skip to content

fix(test): 修复 save_system_persists_project_setting_rows 与 workspace resource settings 不一致 - #414

Merged
su-fen merged 1 commit into
Stack-Cairn:mainfrom
thirsty5034:fix/upstream-settings-test-row-count
Aug 9, 2026
Merged

fix(test): 修复 save_system_persists_project_setting_rows 与 workspace resource settings 不一致#414
su-fen merged 1 commit into
Stack-Cairn:mainfrom
thirsty5034:fix/upstream-settings-test-row-count

Conversation

@thirsty5034

Copy link
Copy Markdown
Contributor

问题

save_system_persists_project_setting_rows 测试在运行时必然失败。

PR #317(feat(workspace): configure Skills and MCP per workspace)为 save_system 新增了 SYSTEM_WORKSPACE_RESOURCE_SETTINGS_KEY 的无条件写入(写入行数 9 → 10),但该测试的期望值未同步更新:

  • assert_eq!(row_count, 9) 仍期望 9 行(实际 10 行)
  • keys 列表缺少 SYSTEM_WORKSPACE_RESOURCE_SETTINGS_KEY

测试中 row_count 断言在最前面,一旦执行会立即 panic。

为什么 CI 一直没发现

该测试是 settings 模块的普通 #[test],没有 #[ignore] 或条件跳过。但 Tauri Rust Check 只运行四个过滤子集(chat_history / ssh_local_forward / shell_runner / integration_commands::mcp),加上 cargo check --tests(仅编译不运行),settings 模块的测试从未被 CI 执行。

该问题是由 fork 侧的全量 cargo test --lib 运行暴露的。

修复

  • row_count 期望 9 → 10
  • keys 列表在 SYSTEM_WORKSPACE_PROJECTS_KEY 后追加 SYSTEM_WORKSPACE_RESOURCE_SETTINGS_KEY(保持 ASC 排序)

验证

修复后的测试在 fork 的全量 cargo test --lib 中通过。

备注:建议后续考虑将 settings 模块纳入 CI 测试范围(例如改为运行全部 --lib 测试),避免此类回归再次隐藏。

…pace resource settings

PR Stack-Cairn#317 added SYSTEM_WORKSPACE_RESOURCE_SETTINGS_KEY writes to save_system
but the row_count expectation and keys list in this test were never
updated. The test only passes when settings tests actually run, which
upstream CI (chat_history/ssh_local_forward/shell_runner/mcp subsets)
never does.
@StackCairn
StackCairn marked this pull request as draft August 9, 2026 15:03
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

PR governance checks failed.

  • No linked issue: the PR body must contain Closes #123 / Fixes #123 / Resolves #123. This project requires an issue before a PR — see the contribution guidelines.

Fix the items above — pushing new commits or editing the PR body will re-run the checks.

@su-fen
su-fen marked this pull request as ready for review August 9, 2026 15:15
@StackCairn
StackCairn marked this pull request as draft August 9, 2026 15:15
@su-fen
su-fen marked this pull request as ready for review August 9, 2026 15:15
@su-fen
su-fen merged commit ecfb038 into Stack-Cairn:main Aug 9, 2026
7 of 10 checks passed
qwenode pushed a commit to qwenode/LiveAgent that referenced this pull request Aug 10, 2026
…pace resource settings (Stack-Cairn#414)

PR Stack-Cairn#317 added SYSTEM_WORKSPACE_RESOURCE_SETTINGS_KEY writes to save_system
but the row_count expectation and keys list in this test were never
updated. The test only passes when settings tests actually run, which
upstream CI (chat_history/ssh_local_forward/shell_runner/mcp subsets)
never does.

Co-authored-by: thirsty5034 <thirsty5034@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants