Skip to content

Suppress SettingsDialog debug logs during test runs#23477

Open
chandu-ops wants to merge 1 commit intogoogle-gemini:mainfrom
chandu-ops:fix-settingsdialog-test-logs
Open

Suppress SettingsDialog debug logs during test runs#23477
chandu-ops wants to merge 1 commit intogoogle-gemini:mainfrom
chandu-ops:fix-settingsdialog-test-logs

Conversation

@chandu-ops
Copy link
Copy Markdown

@chandu-ops chandu-ops commented Mar 22, 2026

Fixes #23328

Summary

Suppress SettingsDialog debug logs during test runs to reduce noisy test output.

Changes

  • Guard debugLogger.log(...) in SettingsDialog so it does not run when NODE_ENV === 'test'

Result

  • Cleaner test output
  • No change to non-test runtime behavior

@chandu-ops chandu-ops requested review from a team as code owners March 22, 2026 18:19
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 22, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 aims to improve the clarity of test output by suppressing unnecessary debug logs from the SettingsDialog component when tests are executed. The changes ensure that debug messages are only logged in non-test environments, maintaining existing runtime behavior while significantly reducing noise during development and CI processes.

Highlights

  • Debug Log Suppression: Implemented a conditional check to prevent SettingsDialog debug logs from appearing during test runs, leading to cleaner test output.
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.

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 aims to reduce noisy test output by suppressing debug logs from the SettingsDialog. The change is effective for its stated purpose. However, I've suggested a more centralized and maintainable approach by modifying the debugLogger itself, which would provide a global solution for suppressing test logs.

Comment on lines +309 to +314
if (process.env.NODE_ENV !== 'test') {
debugLogger.log(
`[DEBUG SettingsDialog] Saving ${key} immediately with value:`,
newValue,
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

While this change correctly suppresses the debug log, a more robust and maintainable approach would be to add this logic directly into the debugLogger implementation in packages/core/src/utils/debugLogger.ts. By making the logger's methods (e.g., log, warn) no-ops when process.env.NODE_ENV === 'test', you would centralize the logic and apply it to all calls across the codebase. This would prevent other components from producing noisy test logs and avoid repeating this environment check elsewhere. If you apply that change, the if condition here would no longer be necessary.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 22, 2026
@chandu-ops chandu-ops force-pushed the fix-settingsdialog-test-logs branch from c2cc77f to a465049 Compare March 23, 2026 06:40
@chandu-ops
Copy link
Copy Markdown
Author

Thanks for the suggestion — that makes a lot of sense.

I agree that centralizing this in debugLogger is more maintainable than repeating environment checks across components.

I’ve updated the implementation to move this logic into the logger so it applies consistently across the codebase, while keeping the change focused on reducing test noise.

@chandu-ops chandu-ops force-pushed the fix-settingsdialog-test-logs branch from d35e577 to 0d103ab Compare March 24, 2026 12:18
@gemini-cli gemini-cli bot added area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. and removed status/need-issue Pull requests that need to have an associated issue. labels Mar 24, 2026
@chandu-ops
Copy link
Copy Markdown
Author

Hi maintainers 👋

It looks like the required workflows are still awaiting approval, so CI hasn't started yet.

Could someone please approve the workflows so the checks can run?

Happy to address any feedback once CI results are available. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

optimize test suite output logging

1 participant