Skip to content

perf(test): remove obsolete structural snapshots - #23777

Merged
nwparker merged 1 commit into
mainfrom
nwparker/test-cleanup
Sep 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/test-cleanup

Conversation

@nwparker

@nwparker nwparker commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36 $\color{#cf222e}{\Huge{\mathbf{−}}}$​165 $\color{#cf222e}{\Huge{\mathbf{−}}}$​129
Prod 3 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​207 $\color{#cf222e}{\Huge{\mathbf{−}}}$​207

ELI5

CI spent several seconds checking old refactor details and waiting on real clocks. This cleanup removes tests that only preserved historical implementation shape and makes the remaining transcript checks deterministic.

What Changed

  • Remove the terminal pane hook-order snapshot that pinned an old hook count, file count, and hash.
  • Remove its unused AST contract support and trim the task-page helper imports left behind.
  • Remove the repo export enumeration snapshot; git behavior remains covered by the git test suite.
  • Keep the terminal quick-command source-boundary check.
  • Convert Claude trust-dialog polling to fake timers while preserving all transcript cases and timeout budgets.
  • Remove the stale timing entry for the deleted test.

Why

The removed tests asserted implementation structure or export enumeration rather than user-visible behavior. They created maintenance work and could fail during harmless refactors. The timer conversion keeps the same 11 scenarios but avoids waiting 6.5–15 seconds for real poll timeouts.

Testing

  • Focused trust-dialog, terminal, task-page, and git suites: 2,589 passed, 9 skipped.
  • Trust-dialog test execution: about 12.6 seconds before, 0.06 seconds after, with all 11 tests retained.
  • Changed-code quality and formatting checks pass.
  • No references remain to removed support modules or tests.

Visual Proof

N/A — test-only cleanup.

Linked Issue

N/A — internal CI performance work.

Review

The deleted snapshots did not exercise runtime behavior. The retained source-boundary and behavioral tests continue to cover quick-command initialization, task-page draft handling, and git behavior.

Checklist

  • This PR is small and focused.
  • Explained the mechanism and alternatives.
  • Self-reviewed correctness and performance.
  • Cross-platform impact considered; timer semantics remain unchanged.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Removes obsolete test files and updates test configuration.

The PR appears safe to merge; the remaining stale timing entry is non-blocking.

Findings

  1. P2 Deleted test timing remains ▶

Summary

The PR removes obsolete structural snapshots and their unused support code, retains the quick-command source check, and uses fake timers for Claude trust-dialog transcript tests. No new actionable issue was found.

Reviews (2) · Last reviewed commit: "perf(test): remove obsolete structural s..."

@@ -1721,7 +1721,6 @@
"src/main/git/remove-worktree-branch-cleanup.test.ts": 163,
"src/main/git/remove-worktree-clean-preflight.test.ts": 125,
"src/main/git/remove-worktree.test.ts": 159,
"src/main/git/repo-api-parity.test.ts": 194,
"src/main/git/repo-branch-conflict-batched-probe.test.ts": 73,

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 Deleted test timing remains Removing the timing for repo-api-parity.test.ts leaves a 504 ms entry for the also-deleted terminal-pane-hook-order-parity.test.ts. Sharding still works, but that obsolete value is included when calculating the fallback weight for tests without timings, including the new quick-command test. Please remove the remaining stale entry so the baseline reflects the discovered suite.

@nwparker
nwparker force-pushed the nwparker/test-cleanup branch from 7892a6f to 599c34f Compare September 29, 2026 03:51

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ Minor suggestions only.

Reviewed changes

  • Removed TerminalPane structural snapshots — deleted terminal-pane-hook-order-parity.test.ts (hook-order hash/count and extracted-file census) and its AST helper refactor-hook-contract.test-support.ts; moved the sole behavioral check (quick-command host work deferred until the context menu opens) verbatim to a new terminal-pane-quick-command-initialization.test.ts.
  • Removed the repo export-surface snapshot — deleted repo-api-parity.test.ts, which pinned Object.keys(repo) rather than behavior.
  • Trimmed dead task-page helper exports — dropped TASK_PAGE_REFACTOR_SOURCE_FILES, readTaskPageRefactorSourceFamily, readFlattenedTaskPageHookFacts, readFlattenedTaskPageHookOrder, and the extracted-files set from task-page-source-family.test-support.ts. Verified no remaining references repo-wide; the retained readTaskPageSource/readTaskPageSourceFamily are still used by four task-page tests.
  • Converted the first Claude trust-dialog describe to fake timers — vi.useFakeTimers() with advanceTimersByTimeAsync, mirroring the pre-existing second describe that already uses fake timers on main. All 11 scenarios and the 15_000/6_500 budgets are retained, and promise.catch(() => {}) is attached before advancing so the expected timeout cannot surface as an unhandled rejection.

One leftover: the timing entry for the deleted terminal-pane-hook-order-parity.test.ts remains (ci-shard-timings.json:7352), noted inline.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@@ -1721,7 +1721,6 @@
"src/main/git/remove-worktree-branch-cleanup.test.ts": 163,
"src/main/git/remove-worktree-clean-preflight.test.ts": 125,
"src/main/git/remove-worktree.test.ts": 159,
"src/main/git/repo-api-parity.test.ts": 194,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This removes the timing entry for the deleted repo-api-parity.test.ts, but the entry for the other test deleted in this PR is still present at line 7352:

"src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts": 504,

It's harmless — ci-shard-timings.md documents that deleted files never enter discovery, so it can't affect balancing — but it contradicts the PR's goal of leaving no references to removed tests. Worth deleting in this pass.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No new changes — the new head is content-identical to the previously reviewed one.

Reviewed changes

  • New head 599c34f versus the prior reviewed head 7892a6f: the PR diff is byte-identical (the commit was rebuilt with no content change), so there is nothing new to review.
  • The single finding from the prior review still stands at 599c34f: config/scripts/ci-shard-timings.json:7352 lists the deleted terminal-pane-hook-order-parity.test.ts. Harmless for shard balancing (deleted files never enter discovery), but inconsistent with the sibling repo-api-parity.test.ts entry this PR removed. Not repeated inline.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit 3976ad4 into main Sep 29, 2026
20 of 29 checks passed
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.

1 participant