test(acp): added restore command coverage#23400
test(acp): added restore command coverage#23400samar-703 wants to merge 5 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the test coverage for the ACP CLI's checkpoint management features. By introducing dedicated unit tests for both the restore and list checkpoint commands, it ensures that these critical functionalities behave as expected across various operational and error conditions, thereby bolstering the overall stability and robustness of the CLI. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds comprehensive unit test coverage for the RestoreCommand and ListCheckpointsCommand in the ACP module. The tests cover various success paths, error conditions, and edge cases. However, I've found a critical issue in one of the tests for ListCheckpointsCommand where an incorrect mock is hiding a bug in the production code. This needs to be addressed to ensure the feature works as expected and the tests provide true confidence.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new unit tests for the RestoreCommand and ListCheckpointsCommand in packages/cli/src/acp/commands/restore.test.ts, covering various scenarios including disabled checkpointing, file not found errors, invalid checkpoint schemas, and proper output formatting. Additionally, the ListCheckpointsCommand in packages/cli/src/acp/commands/restore.ts was updated to explicitly return a 'No checkpoints found.' message when the list is empty and to simplify the displayed checkpoint summary format to show only the checkpoint name and message ID.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
Added unit test coverage for ACP restore commands by introducing a new test suite for:
RestoreCommandListCheckpointsCommandThis improves confidence around checkpoint restore/list behavior and error handling.
Details
Added
packages/cli/src/acp/commands/restore.test.tswith coverage for:RestoreCommandDelegation to list behavior when no args are provided
Checkpointing-disabled response
Missing checkpoint file (
ENOENT) responseSchema validation failure response for checkpoint payload
Restore stream formatting (
message,load_history, fallback object)Unexpected error handling path
ListCheckpointsCommandCheckpointing-disabled response
Empty/no-json checkpoint directory response
Formatted checkpoint summary output
Unexpected error handling path
Related Issues
How to Validate
npm run build --workspace @google/gemini-cli-corenpm run test --workspace @google/gemini-cli -- src/acp/commands/restore.test.ts10/10).Closes #23402
Pre-Merge Checklist