Skip to content

Stabilize git workspace and terminal tests#2540

Merged
juliusmarminge merged 1 commit into
mainfrom
t3code/stabilize-git-workspace-tests
May 6, 2026
Merged

Stabilize git workspace and terminal tests#2540
juliusmarminge merged 1 commit into
mainfrom
t3code/stabilize-git-workspace-tests

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 6, 2026

Summary

  • Added a helper to model visible remote URLs with local rewrites so git workspace tests can represent realistic GitHub remotes while still using local bare repos.
  • Updated multiple git manager scenarios to use the helper and align remote URL formats with the code paths under test.
  • Shortened the pre-commit hook sleep to reduce test runtime and flakiness.
  • Defaulted terminal test processKillGraceMs to 1 so teardown behavior is deterministic when tests do not override it.

Testing

  • Not run locally.
  • Intended checks: bun fmt
  • Intended checks: bun lint
  • Intended checks: bun typecheck

Note

Low Risk
Low risk: changes are confined to tests and test helpers, aiming to reduce flakiness and improve determinism without modifying production logic.

Overview
Improves git-related tests by introducing configureVisibleRemoteUrlWithLocalRewrite, allowing scenarios to use realistic GitHub-style remote URLs while rewriting them to local bare repos via url.<path>.insteadOf.

Updates multiple GitManager.test.ts cases to use this helper (and align SSH URL formats) and reduces the commit-hook sleep time to speed up and de-flake ordering assertions.

Makes terminal manager tests deterministic by defaulting processKillGraceMs to 1 in the createManager fixture when callers don’t specify a value.

Reviewed by Cursor Bugbot for commit 8ee3622. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Stabilize git and terminal tests with URL rewrites and faster timeouts

  • Adds a configureVisibleRemoteUrlWithLocalRewrite helper in GitManager.test.ts that sets a remote's visible URL and adds a url.<localPath>.insteadOf Git config mapping, so operations targeting GitHub-style URLs are transparently redirected to local bare remotes during tests.
  • Updates all test setups for origin, my-org/upstream, and fork-seed remotes to use this helper; the upstream remote's visible URL now uses the ssh:// scheme instead of the previous format.
  • Reduces the pre-commit hook sleep duration in the 'emits ordered progress events for commit hooks' test from 1 second to a short delay.
  • Sets processKillGraceMs to 1 by default in the createManager fixture in Manager.test.ts, instead of leaving it unset when not explicitly provided.

Macroscope summarized 8ee3622.

- Add a helper for visible remote URLs with local path rewrites
- Speed up the pre-commit hook in the git manager tests
- Default terminal kill grace to 1ms in the test harness
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d78dadc6-2633-4ace-b32a-e54a74affc53

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/stabilize-git-workspace-tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 6, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 6, 2026

Approvability

Verdict: Approved

Test-only changes that refactor test setup helpers, reduce test sleep durations, and simplify test configuration. No production code is modified.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit 25c9d26 into main May 6, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the t3code/stabilize-git-workspace-tests branch May 6, 2026 03:31
imabdulazeez added a commit to imabdulazeez/t3code that referenced this pull request May 6, 2026
Brings in: server CLI submodule split (pingdotgg#2545), process/trace diagnostics
views (pingdotgg#2532), JetBrains editor support (pingdotgg#2475), MessagesTimeline render
optimizations (pingdotgg#2527, pingdotgg#2498), git/terminal test stabilization (pingdotgg#2540),
keybindings settings editor (pingdotgg#2533), and provider update advisories
(pingdotgg#2312).

Conflict resolutions:
- packages/contracts/src/settings.ts: kept aa's diffFontFamily and
  terminalFontFamily alongside upstream's
  dismissedProviderUpdateNotificationKeys.
- apps/desktop/src/clientPersistence.test.ts: same shape, fixture mirrors
  the schema.
- apps/web/src/components/settings/SettingsPanels.tsx: kept both import
  groups (FontPicker from aa, ProviderUpdateLaunchNotification.logic from
  upstream).
- apps/web/src/localApi.test.ts: extended both fixtures with
  diffFontFamily and terminalFontFamily so the merged ClientSettings
  shape typechecks against the strict desktop bridge contract.

Pre-existing aa typecheck issues fixed at the root so the merge commit
is green:
- apps/desktop/src/electron.d.ts: declaration-merge "local-fonts" into
  Electron's Session.setPermissionRequestHandler permission union (the
  Electron 40 typings omit it even though the runtime supports it).
- apps/web/src/components/DiffPanel.tsx: conditionally spread style on
  Virtualizer instead of passing undefined, satisfying
  exactOptionalPropertyTypes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant