Skip to content

Conversation

@jackwotherspoon
Copy link
Collaborator

@jackwotherspoon jackwotherspoon commented Nov 28, 2025

Summary

Session Browser Test

One of the Session Browser tests uses the current time relative to Jan 2025 for testing.

So a test that was looking for a session age of 10m now expects 11m because test uses current date.

FAIL  src/ui/components/SessionBrowser.test.tsx > SessionBrowser component > enters search mode, filters sessions, and renders match snippets
Error: Snapshot `SessionBrowser component > enters search mode, filters sessions, and renders match snippets 1` mismatched

- Expected
+ Received

  " Chat Sessions (1 total, filtered)                                              sorted by date desc

   Search: query (Esc to cancel)

     Index │ Msgs │ Age  │ Match
-  ❯ #1    │ 1    │ 10mo │ You:    Query is here a… (+1 more)
+  ❯ #1    │ 1    │ 11mo │ You:    Query is here a… (+1 more)
   ▼"

 ❯ src/ui/components/SessionBrowser.test.tsx:270:25
    268|       expect(lastFrame()).toContain('Chat Sessions (1 total, filtered'…
    269|     });
    270|     expect(lastFrame()).toMatchSnapshot();
       |                         ^
    271|   });
    272| 

Updating test to use fake system time so that tests always pass and don't need to be updated each month 👍

Hook System Tests

A few of the hook system tests added in #9112 do not work on Windows because they use bash scripts and the hook runner uses shell: true, which uses cmd.exe/PowerShell on Windows, not bash.

Skipping them for now, will let @Edilmo see about adding them back.

@jackwotherspoon jackwotherspoon requested a review from a team as a code owner November 28, 2025 18:53
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jackwotherspoon, 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 resolves a flakiness issue in a SessionBrowser component test. The test previously relied on the actual system time, leading to snapshot failures as the perceived 'age' of a session changed over months. By introducing time mocking, the test now operates under a fixed, controlled time, ensuring consistent and reliable results without requiring periodic updates.

Highlights

  • Test Stability: A SessionBrowser component test was failing due to its reliance on the current system time, causing snapshot mismatches as the 'age' of a session changed over time.
  • Time Mocking: Implemented fake system time using vi.useFakeTimers() and vi.setSystemTime() in the beforeEach hook to ensure consistent test results regardless of the actual date, specifically setting the time to '2025-11-01T12:00:00Z'.
  • Test Cleanup: Ensured that real timers are restored after each test run using vi.useRealTimers() in the afterEach hook, preventing side effects on other tests.
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
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 flaky test in SessionBrowser.test.tsx that was caused by using the real system time for relative date calculations. The fix correctly implements vitest's fake timers by setting a fixed time in beforeEach and restoring real timers in afterEach. This is an excellent change that ensures test determinism and prevents future failures due to the passage of time. The implementation is correct and improves the reliability of the test suite.

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Size Change: -2 B (0%)

Total Size: 21.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 21.4 MB -2 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@jackwotherspoon jackwotherspoon changed the title chore: fix session browser test chore: fix session browser test and skip hook system tests Nov 28, 2025
@jackwotherspoon jackwotherspoon added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit 576fda1 Nov 28, 2025
22 checks passed
@jackwotherspoon jackwotherspoon deleted the session-browser-test branch November 28, 2025 21:09
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
@jackwotherspoon
Copy link
Collaborator Author

/patch preview

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 576fda18ebf574b325cd4d5236053e998459fb3c
  • Workflows Created: 1

🔗 Track Progress:

github-actions bot pushed a commit that referenced this pull request Dec 2, 2025
# Conflicts:
#	integration-tests/hooks-system.test.ts
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #14402
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.19.0-preview.0
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.19.0-preview.0-pr-14099

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

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.

4 participants