Skip to content

perf: speed up unit tests and streamline checks - #1488

Merged
thymikee merged 2 commits into
mainfrom
agent/speed-up-unit-tests-and-checks
Jul 29, 2026
Merged

perf: speed up unit tests and streamline checks#1488
thymikee merged 2 commits into
mainfrom
agent/speed-up-unit-tests-and-checks

Conversation

@thymikee

@thymikee thymikee commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

Speed up the slow unit-test tail by replacing real waits, subprocess entrypoints, repeated fixture generation, and native/tool invocations with in-process entrypoints, controlled test seams, fake timing, and reusable fixtures. Behavioral assertions and coverage remain in place; runner adoption drops from roughly 28 seconds to tens of milliseconds in the full suite.

Make repository workflows clearer for agents and newcomers: document focused, affected, and full validation tiers; give common workflows stable script names; route test-app changes to an explicit cached typecheck lane; collapse platform perf aliases into pnpm perf --platform ios|android; and remove stale script/docs duplication.

Remove the misleading build:dev aggregate. Development guidance now points to the exact platform build, while npm prepack delegates to a tested package:npm release guard that builds TypeScript, iOS, macOS, tvOS, visionOS, the macOS helper, packaged Apple source, and both Android helper APKs. The macOS helper is clean-built for publishing so Swift caches cannot leak absolute paths between worktrees.

Validation

  • pnpm check:tooling
  • pnpm check — tooling, build, and Fallow passed; the saturated aggregate unit run passed 4,766/4,770 tests, and the four unrelated load-affected files then passed 137/137 in isolation
  • pnpm test:maestro-compat — 32 files and 201 tests passed
  • pnpm test-app:typecheck
  • pnpm check:affected:test — 32 tests passed
  • pnpm perf --platform invalid — confirmed the single script forwards and validates --platform
  • Publish path — TypeScript, iOS, macOS, and tvOS builds passed; clean macOS-helper build, Apple source packaging, and both Android APK builds passed; visionOS awaits restoration of the temporarily removed local SDK component
  • npm pack --ignore-scripts --dry-run --json — verified the 209-file tarball includes both Android artifact sets, Apple runner source, macOS-helper source, and the TypeScript distribution

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-29 16:54 UTC

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.88 MB 1.87 MB -2.6 kB
JS gzip 604.0 kB 602.9 kB -1.0 kB
npm tarball 722.5 kB 720.7 kB -1.8 kB
npm unpacked 2.53 MB 2.52 MB -6.9 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.2 ms 26.1 ms -0.1 ms
CLI --help 56.6 ms 56.3 ms -0.3 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/recording-export-quality.js +648 B +170 B
dist/src/apps.js +64 B +17 B
dist/src/session.js +15 B +8 B
dist/src/internal/daemon.js -52 B +5 B

@thymikee
thymikee force-pushed the agent/speed-up-unit-tests-and-checks branch 2 times, most recently from dea6e44 to 19be426 Compare July 29, 2026 16:02
@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 29, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed exact head dea6e446: no code findings. The speedups preserve the production contracts: real waits become fake timers or explicit promise barriers, subprocess coverage retains an end-to-end CLI case while pure CLI logic runs in process, native/tool invocations use the existing scoped providers/executor override, and the screenshot worker is bypassed only in high-level pixel-behavior tests. Generic real ZIP and tar extraction coverage remains alongside the faster fixture seam. The new test-app selector maps TS/JS/JSON changes to the CI-backed isolated typecheck and fail-opens for this PR’s own tooling changes. Scoped exact-head validation passed 202/202 touched-suite tests plus 27 check-affected model tests; GitHub has no confirmed failures and remaining smoke/Coverage/FreeRange jobs are in progress. Ready for human review.

@thymikee
thymikee force-pushed the agent/speed-up-unit-tests-and-checks branch from 19be426 to 2073e40 Compare July 29, 2026 16:14
@thymikee
thymikee force-pushed the agent/speed-up-unit-tests-and-checks branch from 2073e40 to c337255 Compare July 29, 2026 16:20
@thymikee
thymikee marked this pull request as ready for review July 29, 2026 16:22
@thymikee
thymikee force-pushed the agent/speed-up-unit-tests-and-checks branch from 3c9c82b to a031843 Compare July 29, 2026 16:42
@thymikee

Copy link
Copy Markdown
Member Author

Follow-up review on a0318436f is clean.

  • Repaired the scheduled perf jobs to use the canonical pnpm perf --platform ios|android surface.
  • Added a path-filtered macOS Package Smoke workflow that executes the real pnpm prepack path when package inputs change.
  • Added regression assertions for the canonical commands and direct workflow inputs.

Validation: focused manifest tests, format, lint, typecheck, build/tooling, layering, metadata, and Fallow passed. The local package run compiled the iOS, macOS, tvOS, and visionOS runner paths; the complete Package Smoke job is queued on this head. Independent Terra re-review found no remaining actionable regression.

@thymikee
thymikee merged commit adcbdda into main Jul 29, 2026
33 checks passed
@thymikee
thymikee deleted the agent/speed-up-unit-tests-and-checks branch July 29, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant