Skip to content

test: add 10 tests for v1.2 features#19

Merged
kienbui1995 merged 1 commit intomainfrom
test/v1.2-features
Apr 11, 2026
Merged

test: add 10 tests for v1.2 features#19
kienbui1995 merged 1 commit intomainfrom
test/v1.2-features

Conversation

@kienbui1995
Copy link
Copy Markdown
Owner

@kienbui1995 kienbui1995 commented Apr 11, 2026

Add test coverage for all 6 new v1.2 features.

Module New Tests Coverage
session.rs to_markdown_basic, to_markdown_with_tool_calls /export markdown
parallel_tools.rs simple_diff_*, diff_preview_*, is_write_tool_check /diff-preview
plugin.rs discover_all_script_types, reads_description, execute_sh_plugin Plugin system

Total: 152 → 162 tests, all passing.

Summary by CodeRabbit

  • Tests
    • Added comprehensive unit test coverage for diff operations, session markdown conversion, and plugin discovery/execution.

- session::to_markdown_basic, to_markdown_with_tool_calls
- parallel_tools::simple_diff_no_changes, simple_diff_detects_changes
- parallel_tools::diff_preview_write_file, diff_preview_edit_file, is_write_tool_check
- plugin::discover_all_script_types, reads_description_from_comment, execute_sh_plugin

Total: 152 → 162 tests
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Three test modules were added to validate existing functionality: parallel_tools.rs tests for diff operations and tool classification, session.rs tests for markdown formatting output, and plugin.rs tests for plugin discovery and execution across supported script types. No production logic was modified.

Changes

Cohort / File(s) Summary
Diff and Tool Classification Tests
mc/crates/mc-core/src/parallel_tools.rs
Added diff_tests module with unit tests validating simple_diff behavior for identical and changed inputs, diff_preview_summary formatting for write_file and edit_file operations, and is_write_tool classification logic.
Session Markdown Output Tests
mc/crates/mc-core/src/session.rs
Added unit tests verifying Session::to_markdown() output structure, including markdown headers, role labels, message text, tool-call formatting with backticked command names, and tool-result icon formatting.
Plugin Discovery and Execution Tests
mc/crates/mc-tools/src/plugin.rs
Added unit tests validating discovery of supported script types (.sh, .py, .js), extraction of tool descriptions from script first-line comments, and execution of shell plugins with PLUGIN_INPUT environment variable passing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A bunny hops through test-filed halls,
With diffs and sessions' happy calls,
Each test a seed in fertile ground,
Plugin plugins safely sound!
No bugs shall sneak past this kind hare,
Coverage blooming everywhere! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: add 10 tests for v1.2 features' accurately describes the main change—adding comprehensive test coverage for v1.2 features across multiple modules with clear, specific focus.
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/v1.2-features

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

@kienbui1995 kienbui1995 merged commit 729c113 into main Apr 11, 2026
4 of 6 checks passed
@kienbui1995 kienbui1995 deleted the test/v1.2-features branch April 11, 2026 09:32
@kienbui1995 kienbui1995 mentioned this pull request Apr 11, 2026
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.

1 participant