为 Rust 后端补充单元测试门禁#361
Merged
H-Chris233 merged 3 commits intoMay 8, 2026
Merged
Conversation
Issue Open-Less#295 calls out that core Rust paths have been too dependent on manual app runs. Keep the change narrow by covering existing pure state/audio/clipboard helpers instead of refactoring coordinator or touching hardware-facing code, then wire the existing lib test suite into the lightweight CI lane. Constraint: Global hotkey, recorder, and insertion integration still require real OS permissions and devices. Rejected: Split coordinator before adding tests | broader refactor would raise review risk and is tracked separately. Confidence: high Scope-risk: narrow Directive: Keep Rust CI on --lib unless integration tests get explicit OS fixtures. Tested: npm run build Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib Tested: cargo check --manifest-path src-tauri/Cargo.toml Not-tested: Live microphone, global hotkey, clipboard, and insertion device paths. Related: Open-Less#295
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍(Review updated until commit ffeaa24)Here are some key observations to aid the review process:
|
The first Open-Less#295 pass made cargo tests visible but still left the reviewer-requested state-machine, modifier-edge, and insertion fallback contracts too implicit. This adds narrow unit coverage around those contracts without refactoring runtime flow.\n\nConstraint: Address review compliance with minimal production changes.\nRejected: Split coordinator or hotkey adapters for testability | broader than the issue and riskier for the active PR.\nConfidence: high\nScope-risk: narrow\nTested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib; cargo check --manifest-path src-tauri/Cargo.toml; npm run build\nNot-tested: Live macOS/Windows native hotkey hooks and clipboard/AX behavior.
|
Persistent review updated to latest commit b082805 |
The Open-Less#295 unit suite now runs in CI, but the Windows clean runner exits before the lib test harness starts with STATUS_ENTRYPOINT_NOT_FOUND when optional native runtime entrypoints are absent. Windows still needs cfg/link coverage, while macOS and Linux can execute the shared Rust unit suite. Constraint: Preserve the new Rust test gate without making optional Windows native runtime installation a CI prerequisite. Rejected: Install Foundry/Windows App Runtime into every CI run | broader, slower, and unrelated to backend unit-test coverage. Confidence: high Scope-risk: narrow Directive: Do not switch Windows back to executing the lib test binary until the optional native runtime dependency is present on the runner. Tested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib Not-tested: Windows CI rerun before push.
|
Persistent review updated to latest commit ffeaa24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
变更说明
coordinator.rs:begin/startup 竞态与录音中止状态边界hotkey.rs:binding / modifier shortcut 更新时 latch 重置边界recorder.rs:下混、量化、RMS/电平、callback liveness 标记insertion.rs:空文本不触发剪贴板/粘贴路径cargo test --manifest-path src-tauri/Cargo.toml --lib。AGENTS.md/CLAUDE.md中 Rust 测试说明,避免继续写“无 cargo test”。验证
npm run buildcargo test --manifest-path src-tauri/Cargo.toml --lib(149 passed)cargo check --manifest-path src-tauri/Cargo.tomlCloses #295
PR Type
Tests, Enhancement, Documentation
Description
Add coordinator session edge tests
Cover hotkey latches on all platforms
Test recorder and insertion helpers
Run Rust lib tests in CI
Update Rust testing guidance docs
Diagram Walkthrough
File Walkthrough
4 files
Add coordinator session edge testsTest hotkey latch reset and dedupeRefactor paste status helpers and testsAdd audio processing helper tests1 files
Gate Rust lib tests in CI2 files
Document Rust lib test workflowDocument Rust lib test workflow