Skip to content

test(acp): added coverage for extensions ACP commands#22798

Closed
samar-703 wants to merge 4 commits intogoogle-gemini:mainfrom
samar-703:test-addition-extension
Closed

test(acp): added coverage for extensions ACP commands#22798
samar-703 wants to merge 4 commits intogoogle-gemini:mainfrom
samar-703:test-addition-extension

Conversation

@samar-703
Copy link
Copy Markdown

@samar-703 samar-703 commented Mar 17, 2026

Summary

Added a new ACP test suite for packages/cli/src/acp/commands/extensions.ts to cover command behavior and error paths that previously had no direct tests.

Closes #22934

Details

  • Added packages/cli/src/acp/commands/extensions.test.ts
    • Covers:
      • ExtensionsCommand delegation
      • list / explore
      • enable / disable (scope handling, --all, failure cases)
      • install / link (validation + success/error paths)
      • uninstall / restart / update
      • MCP auto-enable + restart behavior during enable
    • Test style follows existing Vitest patterns in repo (vi.hoisted, module mocks, focused assertions).

Related Issues

How to Validate

  1. npm run typecheck --workspace @google/gemini-cli
  2. npm run test --workspace @google/gemini-cli -- src/acp/commands/extensions.test.ts
  3. (Optional full gate) npm run preflight

Expected:

  • Typecheck passes
  • New test file passes (25/25)
  • Note: in this local environment, full preflight currently reports unrelated existing failures outside
    this PR scope (modelSteering, AppRig, trackerTools).

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@samar-703 samar-703 requested a review from a team as a code owner March 17, 2026 15:17
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces a new, comprehensive test suite for the ACP extension commands within the CLI. This suite significantly improves code coverage by validating the behavior and error handling of commands such as enabling, disabling, installing, linking, uninstalling, restarting, and updating extensions, ensuring the robustness and reliability of the extension management system.

Highlights

  • New Test Suite for ACP Extensions: Added a comprehensive test suite for the packages/cli/src/acp/commands/extensions.ts file, significantly increasing test coverage for extension-related commands.
  • Command Behavior Coverage: Tests now cover the delegation of ExtensionsCommand, as well as the functionality of list, explore, enable, disable, install, link, uninstall, restart, and update commands.
  • Error Path and Edge Case Validation: The new tests include validation for various error paths, scope handling (user, workspace, session), --all flag behavior, and specific failure cases for installation and uninstallation.
  • MCP Server Interaction Testing: Included tests to verify the auto-enablement and restart behavior of MCP servers during the extension enablement process.
Changelog
  • packages/cli/src/acp/commands/extensions.test.ts
    • Added comprehensive unit tests for ACP extension commands, covering various functionalities and error conditions.
Activity
  • No human activity has been recorded yet for this pull request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a comprehensive test suite for the ACP extension commands, significantly improving test coverage. The tests are well-structured and cover many success and failure scenarios. I've identified a couple of areas where error path coverage could be improved, specifically for handling non-existent extensions in the disable and uninstall commands. Adding these tests will make the suite even more robust.

Comment thread packages/cli/src/acp/commands/extensions.test.ts
Comment thread packages/cli/src/acp/commands/extensions.test.ts
@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label Mar 17, 2026
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Apr 1, 2026

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!

@gemini-cli gemini-cli Bot closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Issues related to Gemini CLI extensions capability priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(acp): add missing coverage for extensions command error paths

1 participant