You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ios-runner): move ~3.9k lines of inline unit tests out of production Swift files; split CommandExecution under 1,000 lines #2792
About 3,900 lines of runner unit tests are compiled into production source files under #if AGENT_DEVICE_RUNNER_UNIT_TESTS. They are stripped from packaged source (src/__tests__/apple-runner-package-source.test.ts:34-35), so this is about source size and readability, not binary size. The biggest cases (paths under apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/, at 01328de411):
File
Total lines
Inline test lines
RunnerTests+CommandExecution.swift
2,856
~786
RunnerTests+AXSnapshotFallback.swift
~549
RunnerTests+SnapshotCapturePlan.swift
~471
RunnerTests+CommandJournal.swift
~334
RunnerTests+Snapshot.swift
~239
RunnerTests+PrivateAXPresentation.swift
~206
RunnerTests+CommandExecution.swift breaks the 1,000-line rule in AGENTS.md. Tests are also meant to mirror source files one to one. UnitTests/ (26 files) already exists as the home for these tests.
Required behavior
Move each inline test block to UnitTests/RunnerTests+<SourceName>Tests.swift. Keep the same test names and the same #if guard. Widen private to internal only where a moved test needs it.
Do this as a pure move: no test logic changes, one PR per source file or a small batch. Pure moves carry their tests unchanged, as AGENTS.md requires.
After the moves, split RunnerTests+CommandExecution.swift under 1,000 lines along command families (tap/press, scroll/drag, type, screenshot/record). The splits are pure moves too.
Completion conditions
grep -c AGENT_DEVICE_RUNNER_UNIT_TESTS on each production file (not under UnitTests/) returns 0, or only guards test seams, not whole test blocks.
wc -l apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift is under 1,000, and so is every file split out of it.
pnpm check:xctest-selection and pnpm check:packaged-runner-swift are green. The macOS host lane test count is the same before and after; paste both counts in the PR.
Follow-up (not part of this issue)
Move the pure policies (tap point, scroll viewport, keyboard band, journal, commit progress) into a SwiftPM package, following apple/snapshot-presentation, and test them with Swift Testing @Test(arguments:) against contracts/fixtures.
Activity
refactor(move): move the runner's inline unit tests into UnitTests/
chore(gates): describe the runner's test membership without the moved…
refactor(move): move the runner's inline unit tests into UnitTests/
chore(gates): describe the runner's test membership without the moved…
refactor(move): move the runner's inline unit tests into UnitTests/ (#…
refactor(move): split RunnerTests+CommandExecution.swift along comman…