Goal: no feature ships unless unit, integration, UI/usability and security checks pass, locally and in CI. Real Bluetooth with the Pixel cannot run in CI; it is covered by a manual hardware checklist.
Playwright automates browsers, Electron and web views. Pickup is a native AppKit/SwiftUI menu bar app, so Playwright cannot see its windows. XCUITest would be the Apple way, but it needs an Xcode UI-test bundle and runner and fails under swift test ("Device is not configured for UI testing"). We therefore drive the app through the macOS Accessibility API (AXUIElement and CGEvent) from a plain XCTest package (App/Tests/PickupUITests), plus in-process tests.
- Unit (XCTest,
swift test) – pure logic with no hardware:PickupCore(AT parser,CallEngine,DialNumber, redaction, sanitizer, reconnect controller),PickupBluetoothwith fake links,Apppure types (contact search, keypad rules, key combos, number format). Already about 230 tests; every bug fix adds a regression test. - Scenario tests (XCTest) – a scripted phone (
ScriptedPhoneTransport/fake transport) plays complete calls throughCallEngineand the app model: incoming → accept / decline / missed, outgoing → remote answers / cancel, hang up during dialing, call waiting, link loss and call resume, sleep/wake, SCO opened unexpectedly. Replays of real Pixel logs (Fixtures/) stay. - Property and fuzz tests – seeded randomised tests for everything that parses untrusted input: AT lines from the phone,
tel:/callto:URLs, pasted text,DialNumber,ATLogSanitizer,PhoneNumberRedaction; random event sequences intoCallEnginemust never crash, never leave a call stuck, never dial without a command. Failing seeds are printed and added as fixtures. - UI and usability tests (Accessibility API harness,
scripts/run-ui-tests.sh) – the realPickup.applaunched with-PickupTestScenario <name>, which swapsAppleHFPTransportfor the scripted phone and contacts for invented ones (no Bluetooth, no real contacts, no real calls). Checks: popover opens from the status item and the global shortcut; search → ↑/↓ → Return dials the right row; digits typed open the keypad and light the key;+long press; Esc semantics;⌘,⌘Q⌘W; banner shows caller, Accept/Decline work, banner never takes keyboard focus; HUD timer, hang-up, ended state; the call-UI stress cycle (the stack-overflow regression); Settings opens in front and stays compact. Accessibility checks (labels, roles, identifiers and values present;performAccessibilityAuditis not available outside XCUITest), full keyboard operation, VoiceOver labels, Reduce Motion, light/dark, and English and German (no truncated or overlapping text). Screenshot snapshots of key views in both languages and appearances catch visual regressions. - Hardware checklist (manual, maintainer) – a short smoke script for reconnect, sleep/wake, real call with the Pixel. Not part of the automated gate.
Threat model (short): untrusted inputs are AT lines from the phone, tel:/callto: URLs from any app or web page, pasted text, contact data; dangerous outputs are placing calls (cost, service codes such as call forwarding), AT command injection, and leaking numbers, names or DTMF into logs. The app has no network access and no third-party dependencies, and should keep it that way.
- Automated checks: injection tests (CR/LF/
;/%0D/%3B, service codes, MMI viatel:), no dialing without an explicit Return/click, log canary tests (run scenarios with canary numbers/names/DTMF and assert none appears in any log file or unified-log message), entitlement audit (only Bluetooth and Contacts; sandbox state recorded; hardened runtime for release builds),codesign --verify --strict --deep, no networking symbols/frameworks linked,Package.resolvedhas no external packages. - Static analysis and hygiene: warnings as errors, SwiftLint (no force-unwrap/
try!/fatalErroroutside tests and explicit exceptions, unused code), secret scan (gitleaks), CodeQL for Swift and dependency review on GitHub, AddressSanitizer and ThreadSanitizer test runs (swift test --sanitize=address|thread), a leak check in the stress self-test. - Review:
code-reviewerbefore every commit that touches Bluetooth or audio, but after two rounds test instead of reviewing more.
One command runs, in order: build all packages with warnings as errors → lint → localization check → unit/scenario/property tests (root, App, spikes) → sanitizer runs → security checks → UI tests (need the Accessibility permission for the process running the gate; they take over mouse and keyboard for about two minutes; never skipped in release). It exits non-zero on the first failure and writes a stamp for the current git tree hash. scripts/build-app.sh runs the gate first and refuses to produce Pickup.app unless it passed (PICKUP_SKIP_VERIFY=1 only for quick local builds; ignored for release).
Details and the setup checklist: docs/RELEASING.md.
.github/workflows/ci.ymlon every pull request intomain, on pushes tomain, weekly and on demand:release tooling(pnpm frozen install, release-it, version files),lint,localization,test(root, App, spikes when present; warnings as errors),sanitizers(address root+App, thread root),security(scripts/security-checks.sh --strictwith gitleaks and semgrep), thenbuild(needs:all of them) packages an unsigned DMG/ZIP.pr-title.ymlchecks that the pull request title is a Conventional Commit. Themainruleset requires all of them. Runner: GitHub'sxcode-27image (macOS 27, preview).- UI tests stay a local gate (
scripts/verify.sh, run by David on the release pull request): the CI job exists but is opt-in and may not fail the run until the runner's Accessibility permission is proven. - Releases:
prepare-release.yml(manual) runs release-it on arelease/vX.Y.Zbranch and opens the release pull request; squash-merging it startsrelease.yml, which runsci.ymlagain on that commit, then (protected environmentrelease) tags, builds, signs and notarises (or packages an unsigned 0.x pre-release), publishes the GitHub Release and updates the Homebrew tap for signed releases. - Dependabot (Actions and the pnpm release tooling, Conventional titles); every action is pinned to a commit SHA (
scripts/pin-actions.sh). The workflows never run outsidemacx/pickup(repository guard).
- Compiled out of release:
App/Package.swiftdefinesPICKUP_TESTINGfor the debug configuration only;swift build -c release(andscripts/build-app.sh release) contains none of the hook code (checked: noPickupTestScenario,ScriptedTransportor control-channel strings in the release binary).TestMode.isActiveis a constantfalsethere. - Launch:
Pickup -PickupTestScenario <name> [-PickupTestFastClock YES] [-PickupTestClockScale 0.25] [-PickupTestAutoAdvance <ms>] -AppleLanguages "(de)". The app shows "Connected to Test Phone" and uses a scripted phone (ScriptedTransport); no Bluetooth, noCNContactStore, no default-app change, no global shortcut registration, no notification or TCC prompts, logs in$TMPDIR/pickup-test-logs, the real preferences are never read or written for the phone. - Scenarios:
idle,incoming-accept,incoming-decline,incoming-missed,incoming-withheld,outgoing-answered,outgoing-busy,outgoing-cancel,call-waiting,link-loss-resume,stress-cycle. Incoming ones ring Jane Doe (withheld: no number) 0.4 s after launch; outgoing ones start when the UI dials (the scripted phone answersATD). - Advancing the script: post the distributed notification
dev.eiken.pickup.test.advance(DistributedNotificationCenter.default().post(name: .init("dev.eiken.pickup.test.advance"), object: nil)); each post runs the next step (seeTestHarness.script(for:): e.g.outgoing-answered= alerting, answered, remote hangs up).-PickupTestAutoAdvance <ms>steps automatically. - Fast clock: with
-PickupTestFastClock YESthe engine's delays (setup-end grace, 4 s ended display, timeouts) run atscale(default 0.25), so the ended state stays visible about 1 s. The call timer still shows real seconds. - Invented contacts (any scenario or
-PickupDemo): Jane Doe +49 170 0000123, John Roe +49 171 0000456 (both mobile), a very long German name, Max Mustermann with mobile/work/home numbers, Øystein Åberg. - Identifiers:
status-item,popover-root,search-field,search-clear,keypad-toggle,key-0...key-9,key-star,key-hash,key-plus(the "+" under 0; long-presskey-0instead),keypad-call,call-row,contact-row-<id>-<index>(ids: jane, john, long, multi, oystein),more-button, menu itemsmenu-settings,menu-about,menu-quit,incoming-banner,banner-caller,banner-accept,banner-decline,call-hud,hud-caller,hud-timer,hud-state,hud-hangup,hud-close,hud-mute,hud-keypad,hud-move-to-phone, windowsettings-window,settings-phone-picker,settings-phone-options,settings-take-calls,settings-shortcut-recorder,settings-shortcut-clear,settings-make-default,settings-contacts-button,settings-notifications-toggle,settings-launch-at-login.