Skip to content

test: remove color workaround#64

Merged
chenjiahan merged 1 commit intomainfrom
test_color_0308
Mar 8, 2026
Merged

test: remove color workaround#64
chenjiahan merged 1 commit intomainfrom
test_color_0308

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

close #60

Copilot AI review requested due to automatic review settings March 8, 2026 01:27
@gemini-code-assist
Copy link
Copy Markdown

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 streamlines the test configuration by removing a previously necessary workaround for color output. This change suggests that the underlying issue requiring the NO_COLOR environment variable has been resolved or is no longer relevant, leading to cleaner and more standard test execution.

Highlights

  • Test Configuration: Removed the explicit setting of process.env.NO_COLOR = '1' from rstest.config.ts, indicating that this workaround is no longer needed for test execution.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • rstest.config.ts
    • Removed the process.env.NO_COLOR setting.
Activity
  • No specific activity has been recorded for this pull request since its creation.
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

@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 removes a workaround that disabled colors in the test environment by removing the NO_COLOR environment variable setting. While this is a good cleanup, it will likely cause some existing snapshot tests to fail because they do not account for the new color codes in the output. I have added a comment with specific details on the affected tests and how to resolve the issue.

@chenjiahan chenjiahan merged commit 5353fa7 into main Mar 8, 2026
6 checks passed
@chenjiahan chenjiahan deleted the test_color_0308 branch March 8, 2026 01:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e53b09e31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


process.env.NO_COLOR = '1';

export default defineConfig({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep NO_COLOR set for deterministic snapshot tests

Removing the NO_COLOR assignment makes test output depend on the caller’s terminal/color env, and tests/logger.test.ts still has snapshot assertions (should log error with stack correctly / should log error with cause correctly) that compare raw logger strings without stripAnsi; when FORCE_COLOR=1 (or another color-enabling setup) util.styleText adds ANSI escapes and these snapshots no longer match. Keeping NO_COLOR in test config (or stripping ANSI in those tests) avoids this environment-specific failure.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

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

Removes a test-only environment-variable workaround (NO_COLOR) from the @rstest/core configuration, aligning behavior with the upstream change referenced in PR #60.

Changes:

  • Remove process.env.NO_COLOR = '1' from rstest.config.ts so test output coloring behavior is no longer forcibly disabled by the repo config.

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

process.env.NO_COLOR = '1';

export default defineConfig({
globals: true,
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

Removing the NO_COLOR override can make snapshot expectations sensitive to whether ANSI styling is enabled in the test environment. In this repo, the logger error snapshots (e.g. logger.error(err) cases) don't strip ANSI codes, so if util.styleText starts emitting color again those snapshots can change. Consider either keeping the env override in test config, or updating the error snapshot assertions/setup to normalize/strip ANSI so snapshots remain deterministic across environments.

Suggested change
globals: true,
globals: true,
env: {
NO_COLOR: '1',
},

Copilot uses AI. Check for mistakes.
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.

2 participants