Skip to content

[tests] Be robust against cross-platform differences#285

Merged
joshlf merged 1 commit intomainfrom
G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7
Feb 9, 2026
Merged

[tests] Be robust against cross-platform differences#285
joshlf merged 1 commit intomainfrom
G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7

Conversation

@joshlf
Copy link
Owner

@joshlf joshlf commented Feb 9, 2026

In snapshots, filter out some macOS-specific strings to ensure snapshots
remain identical cross-platform.


Latest Update: v2 — Compare vs v1

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v1 Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 && git checkout -b pr-G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 FETCH_HEAD

Checkout

git fetch origin refs/heads/G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link

Summary of Changes

Hello @joshlf, 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 focuses on improving the reliability and consistency of the test suite across different operating systems. It addresses issues related to path variations and error messages that can lead to inconsistent test results on macOS compared to Linux. By adding redaction rules and filtering specific error messages, the changes ensure that test snapshots remain identical regardless of the platform.

Highlights

  • Cross-Platform Robustness: The primary goal is to enhance the test suite's resilience against platform-specific differences, particularly between macOS and Linux environments.
  • Path Redaction: The changes introduce additional redaction rules to handle path variations observed on macOS (e.g., /private/var vs. /var).
  • Error Message Filtering: The update includes filtering of a 'remote end hung up unexpectedly' Git error message that appears inconsistently across different platforms and Git versions.
Changelog
  • testutil/src/lib.rs
    • Modified sanitize_with_redactions function to include additional redactions for macOS path differences and a specific Git error message.
Activity
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

@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 aims to make test snapshots more robust across different platforms by adding more string redactions. The implementation refactors the redaction logic to use an iterator chain. However, this refactoring unintentionally changes the order of operations, which could break existing tests that rely on path redactions being applied first. I've suggested a fix to restore a safe order of redactions while keeping the new iterator-based approach.

In snapshots, filter out some macOS-specific strings to ensure snapshots
remain identical cross-platform.

gherrit-pr-id: G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7
@joshlf joshlf force-pushed the G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 branch from 00950c2 to 33ce692 Compare February 9, 2026 15:37
@joshlf joshlf merged commit e066bcc into main Feb 9, 2026
1 check passed
@joshlf joshlf deleted the G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 branch February 9, 2026 15:40
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