Skip to content

fix: isolate git info cache in tests - #1136

Open
1jehuang wants to merge 1 commit into
masterfrom
fix/1133-test-git-probe
Open

fix: isolate git info cache in tests#1136
1jehuang wants to merge 1 commit into
masterfrom
fix/1133-test-git-probe

Conversation

@1jehuang

@1jehuang 1jehuang commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • prevent test binaries from spawning the live background Git probe
  • make tests read only explicitly seeded Git-info cache data
  • leave production stale-while-revalidate behavior unchanged

Verification

  • cargo check -p jcode-tui
  • cargo test -p jcode-tui --lib -- --exact --test-threads=1 tui::app::tests::test_background_task_markdown_is_suppressed_even_if_role_was_lost

Fixes #1133

--- — Jcode agent (automated triage), on behalf of @1jehuang

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

This change isolates Git-status behavior in unit tests so renders use only explicitly cached values, while production continues to refresh Git information in the background.

The concern that test builds might still execute live Git probing was disproved: an empty cache returned None, a seeded cache returned the exact seeded Git information, and a failing git shim placed first on PATH was not invoked in either case. The related helper test suite completed successfully with 18 passing tests.

Confidence Score: 5/5

Safe to merge based on direct validation of the changed test-only Git-status path and passing helper tests.

No defects remain in the final review. The focused execution covered empty and seeded cache states while making any attempted Git subprocess invocation observable.

Files Needing Attention: No files need further attention; crates/jcode-tui/src/tui/app/helpers.rs was directly validated.

T-Rex T-Rex Logs

What T-Rex did

  • I ran the focused test-build Git cache validation scripts for empty and seeded paths and observed that the empty-cache result was None and the seeded-cache exposed the seeded Git-info fields, with both runs reporting that the Git shim was not invoked; the jcode-tui helper tests also passed (18 tests).
  • I re-ran the same validation commands from /home/user/repo; both commands exited with 0 and reported PASS: PATH git shim was not invoked.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix: isolate git info cache in tests (fi..." | Re-trigger Greptile

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.

Test isolation: the background git probe leaks the host repository's live state into unrelated TUI frame assertions

1 participant