Skip to content

fix(e2e): ensure environment variables are truly unset in CLI helper#909

Merged
fi3ework merged 1 commit intomainfrom
ee2e
Jan 27, 2026
Merged

fix(e2e): ensure environment variables are truly unset in CLI helper#909
fi3ework merged 1 commit intomainfrom
ee2e

Conversation

@fi3ework
Copy link
Copy Markdown
Member

Summary

  • Fix runRstestCli helper to correctly unset environment variables by setting them to undefined instead of deleting the keys
  • Fix an issue where parent process environment variables (like FORCE_COLOR) were being merged back into the spawned process due to tinyexec behavior

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 27, 2026 08:12
@fi3ework fi3ework enabled auto-merge (squash) January 27, 2026 08:12
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fi3ework, 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 refines the end-to-end testing utility to ensure precise control over environment variables for spawned CLI processes. It specifically addresses a subtle interaction with tinyexec that caused intended-to-be-unset environment variables to persist, thereby improving the reliability and isolation of test environments.

Highlights

  • Environment Variable Unsetting Fix: The runRstestCli helper has been updated to correctly unset environment variables by setting their values to undefined instead of merely deleting the keys from the environment object.
  • tinyexec Merging Behavior Addressed: This change resolves an issue where parent process environment variables (e.g., FORCE_COLOR) were being merged back into spawned processes due to the tinyexec utility's environment merging logic, ensuring true isolation for test runs.
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 addresses a bug in the runRstestCli end-to-end test helper, ensuring that environment variables are correctly unset in child processes. The modification to set the environment variable key to undefined instead of deleting it is the correct approach to handle how tinyexec and Node.js's child_process module manage environment variable inheritance. The change is well-documented with a clear comment explaining the rationale, leading to a more robust and reliable test setup.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the runRstestCli helper function where environment variables were not being properly unset in spawned CLI processes. The issue occurred because tinyexec internally merges environments as { ...process.env, ...options.env }, so simply deleting keys from the options object was insufficient when the parent process had those variables set.

Changes:

  • Modified environment variable unsetting logic to use undefined assignment instead of key deletion

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fi3ework fi3ework merged commit c0e6f3c into main Jan 27, 2026
16 of 17 checks passed
@fi3ework fi3ework deleted the ee2e branch January 27, 2026 08:27
@fi3ework fi3ework mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants