Skip to content

feat(tools): Add check, format and test tools for the macOS app - #1011

Open
JeanMertz wants to merge 3 commits into
mainfrom
pr/swift-tools
Open

feat(tools): Add check, format and test tools for the macOS app#1011
JeanMertz wants to merge 3 commits into
mainfrom
pr/swift-tools

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

The Rust side of this repository can be built, linted, formatted and
tested from inside a conversation. The Swift side could not, which made
the app the one place where a change had to be handed back to a human to
find out whether it even compiled. These close that gap: each shells out
to a toolchain binary from the repository root and reports diagnostics
rather than raw build logs, the way the cargo_* tools do.

Every tool that builds brings its own inputs up to date first — the
jp_ffi static library, its generated header, and the Xcode project —
so there is no setup step to forget and no failure mode where the tools
disagree with what just would have produced.

xcodebuild repeats the failing command line in full for every error,
so a broken build's tail is almost entirely noise; diagnostics are
capped and the head is what survives. swift_check builds the app,
swift_format formats or reports without rewriting, and swift_test
runs the unit tests and the jpdrive package.

swift_test_ui is separate and requires test names. A UI test takes
over the screen for as long as it runs, so the whole bundle is CI's job
rather than something a conversation should trigger by accident; asking
for the suite by name is the guard. It stops at the first failure and
closes the app the run left behind, unless CI=1 says to finish and
report everything.

Stopping early needs the process interrupted rather than killed, which
run_until on the shared runner now supports. SIGINT gives
xcodebuild the chance to tear down its test session, and tearing down
that session is what stops the app the test was driving; killed
outright, it leaves that app sitting on the screen. Five seconds to
unwind, then a kill.

A failure copies the screenshots the run recorded into tmp/uitests/,
because a UI test that failed on something visual is unreadable from its
assertion alone.

Signed-off-by: Jean Mertz git@jeanmertz.com

@JeanMertz
JeanMertz force-pushed the pr/swift-tools branch 2 times, most recently from 292d31c to cef7312 Compare August 21, 2026 21:57
Base automatically changed from pr/uitests to main August 22, 2026 20:08
The Rust side of this repository can be built, linted, formatted and
tested from inside a conversation. The Swift side could not, which made
the app the one place where a change had to be handed back to a human to
find out whether it even compiled. These close that gap: each shells out
to a toolchain binary from the repository root and reports diagnostics
rather than raw build logs, the way the `cargo_*` tools do.

Every tool that builds brings its own inputs up to date first — the
`jp_ffi` static library, its generated header, and the Xcode project —
so there is no setup step to forget and no failure mode where the tools
disagree with what `just` would have produced.

`xcodebuild` repeats the failing command line in full for every error,
so a broken build's tail is almost entirely noise; diagnostics are
capped and the head is what survives. `swift_check` builds the app,
`swift_format` formats or reports without rewriting, and `swift_test`
runs the unit tests and the `jpdrive` package.

`swift_test_ui` is separate and requires test names. A UI test takes
over the screen for as long as it runs, so the whole bundle is CI's job
rather than something a conversation should trigger by accident; asking
for the suite by name is the guard. It stops at the first failure and
closes the app the run left behind, unless `CI=1` says to finish and
report everything.

Stopping early needs the process interrupted rather than killed, which
`run_until` on the shared runner now supports. `SIGINT` gives
`xcodebuild` the chance to tear down its test session, and tearing down
that session is what stops the app the test was driving; killed
outright, it leaves that app sitting on the screen. Five seconds to
unwind, then a kill.

A failure copies the screenshots the run recorded into `tmp/uitests/`,
because a UI test that failed on something visual is unreadable from its
assertion alone.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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