Stabilize git workspace and terminal tests#2540
Conversation
- 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
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: 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. |
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.
Summary
processKillGraceMsto1so teardown behavior is deterministic when tests do not override it.Testing
bun fmtbun lintbun typecheckNote
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 viaurl.<path>.insteadOf.Updates multiple
GitManager.test.tscases 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
processKillGraceMsto1in thecreateManagerfixture 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
configureVisibleRemoteUrlWithLocalRewritehelper in GitManager.test.ts that sets a remote's visible URL and adds aurl.<localPath>.insteadOfGit config mapping, so operations targeting GitHub-style URLs are transparently redirected to local bare remotes during tests.origin,my-org/upstream, andfork-seedremotes to use this helper; the upstream remote's visible URL now uses thessh://scheme instead of the previous format.'emits ordered progress events for commit hooks'test from 1 second to a short delay.processKillGraceMsto1by default in thecreateManagerfixture in Manager.test.ts, instead of leaving it unset when not explicitly provided.Macroscope summarized 8ee3622.