test: fix failures due to antigravity environment leakage#26162
test: fix failures due to antigravity environment leakage#26162adamfweidman merged 1 commit intomainfrom
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 addresses intermittent test failures caused by environment variable leakage and improper file system isolation. By explicitly stubbing environment variables and redirecting the CLI home directory to temporary sandbox locations during test execution, the changes ensure a consistent and isolated testing environment. 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
|
|
Hi @adamfweidman, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
d02c9d2 to
c9501df
Compare
There was a problem hiding this comment.
Code Review
This pull request addresses test environment leakage by utilizing vi.stubEnv to isolate environment variables such as ANTIGRAVITY_CLI_ALIAS and GEMINI_CLI_HOME within the CLI and core test suites. Feedback was provided regarding extensive, likely accidental changes in package-lock.json where "peer": true was added to numerous dependencies; these changes should be reverted to ensure a clean and predictable dependency tree.
I am having trouble creating individual review comments. Click here to see my feedback.
package-lock.json (453)
The package-lock.json file contains extensive, seemingly accidental changes adding "peer": true to numerous dependencies (e.g., @bufbuild/protobuf, zod, vitest). These changes are unrelated to the PR's objective of fixing test environment leakage and likely indicate a corrupted lockfile or an incompatible npm version used during development. Please revert these changes to maintain a clean and predictable dependency tree.
|
Size Change: -4 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
Summary
Fixes test failures in
contentGenerator.test.tsandExtensionManagersuites caused by environment leakage (specificallyANTIGRAVITY_CLI_ALIASand home directory leakage).Details
ANTIGRAVITY_CLI_ALIAS: IncontentGenerator.test.ts,extension-manager-agents.test.ts, andextension-manager-hydration.test.ts, I addedvi.stubEnv('ANTIGRAVITY_CLI_ALIAS', '')to ensures that theUser-Agentgenerated during tests is consistent and doesn't include unexpected "antigravity" tags from the host environment.ExtensionManagerTests: Updated thebeforeEachblocks inextension-manager-agents.test.tsandextension-manager-hydration.test.tsto setGEMINI_CLI_HOMEto a temporary directory. This correctly redirects all file operations (including settings and integrity stores) to a sandbox environment, preventing "Extension integrity store cannot be verified" errors.Related Issues
N/A
How to Validate
Run the targeted tests:
Or run the full preflight:
Pre-Merge Checklist