Skip to content

fix(test): 全局语言状态互斥锁隔离并行测试 - #11

Merged
VincentZyu233 merged 1 commit into
VincentZyuApps:mainfrom
ra1nyxin:fix/serialize-i18n-tests
Aug 27, 2026
Merged

VincentZyu233 merged 1 commit into
VincentZyuApps:mainfrom
ra1nyxin:fix/serialize-i18n-tests

Conversation

@ra1nyxin

@ra1nyxin ra1nyxin commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Rust 帮助文本测试共享进程级语言状态,并行执行时可能读取到其他测试临时设置的语言。

为相关测试增加互斥锁,并在 Emoji 测试开始时明确设置英文,消除这类不稳定失败。

本地未运行测试,交由 CI 验证。

Summary by CodeRabbit

  • Tests
    • Improved test reliability by preventing concurrent language-setting tests from interfering with one another.
    • Ensured localized help and keyboard shortcut tests run consistently.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5275bfa-39ed-465e-bf48-c46963d26e58

📥 Commits

Reviewing files that changed from the base of the PR and between fce6635 and 43bc165.

📒 Files selected for processing (1)
  • rust/src/cli.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

CLI tests that modify the process-global display language now use a shared mutex. This prevents concurrent language changes while tests generate localized help output.

Changes

CLI test isolation

Layer / File(s) Summary
Serialize display-language changes
rust/src/cli.rs
Defines LANGUAGE_LOCK and uses it in both tests that call set_lang.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 43bc1

The PR serializes test-time changes to shared language state and prevents parallel tests from interfering with one another without changing production behavior. No actionable merge-blocking risk remains beyond normal checks.

Suggested reviewers: vincentzyu233

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding mutual exclusion for shared global language state in parallel tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VincentZyu233
VincentZyu233 merged commit 3c8d602 into VincentZyuApps:main Aug 27, 2026
28 checks passed
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