Skip to content

test: add E2E coverage for Build sheet SSH agent forwarding - #121

Merged
henrywang merged 1 commit into
mainfrom
119-build-ssh-e2e-test
Aug 23, 2026
Merged

test: add E2E coverage for Build sheet SSH agent forwarding#121
henrywang merged 1 commit into
mainfrom
119-build-ssh-e2e-test

Conversation

@henrywang

Copy link
Copy Markdown
Owner

Summary

  • Adds ResourceJourneyTests.testBuildWithSSHForwardingMountsAgentSocket: checks the Build sheet's "Forward SSH agent" toggle (Add SSH forwarding support to Build sheet #110), then builds an image whose Dockerfile has a RUN --mount=type=ssh sh -c 'test -n "$SSH_AUTH_SOCK" && test -S "$SSH_AUTH_SOCK"' step. That step is the oracle — it fails the build outright unless a real forwarded socket is present inside the guest, so a passing build is genuine proof of forwarding, not just proof that a build with the box checked didn't error.
  • Skips (not fails) specifically when LiveContainerService.buildConfigSSH's own pre-flight validation reports SSH_AUTH_SOCK isn't visible to the app process — GUI-launched apps don't reliably inherit a login shell's agent socket, so that's an environment limitation, not a feature bug. Any other failure — including the guest-side RUN step actually failing — still fails the test; the skip path checks the exact validation message text, not just "any failure."
  • Adds accessibilityIdentifiers the test needed: buildSshToggle on the toggle, buildErrorMessage on the sheet's failure text — both previously unqueryable except by label/text matching.

Test plan

  • xcodebuild build succeeds
  • BerthlyTests suite passes (no logic changes, but ran for regression safety)
  • BerthlyUITests build-sheet mock tests pass (testBuildContinuesInBackgroundAndSurfacesInBuildsIndicator, testBuildSheetOpensAndClosesWithoutCrashing) — confirms the two new identifiers don't disturb existing sheet behavior
  • scripts/e2e.sh ResourceJourneyTests/testBuildWithSSHForwardingMountsAgentSocket against the real local daemon — passed (not skipped) in ~25s: this machine's SSH_AUTH_SOCK is visible to the app, and forwarding genuinely works end to end
  • swiftlint lint --strict — 0 violations

Fixes #119

Checks the "Forward SSH agent" toggle (#110) and builds an image whose
Dockerfile has a RUN --mount=type=ssh step that fails the build outright if
SSH_AUTH_SOCK isn't a real forwarded socket inside the guest — that's the
oracle, so a passing build is proof forwarding actually worked, not just
that a build with the box checked didn't error.

Skips (doesn't fail) specifically when LiveContainerService.buildConfigSSH's
own pre-flight validation reports SSH_AUTH_SOCK isn't visible to the app
process — a GUI launch doesn't reliably inherit a login shell's agent
socket, so that's an environment limitation, not a feature bug. Any other
failure, including the guest-side RUN step failing, still fails the test.

Adds accessibilityIdentifier to the toggle (buildSshToggle) and the build
sheet's failure message (buildErrorMessage) so the test can drive/read them
precisely rather than by label text.

Verified via scripts/e2e.sh against the real local daemon: passed (not
skipped) in ~25s, confirming SSH_AUTH_SOCK is visible to the app on this
machine and forwarding genuinely works end to end.

Fixes #119
@henrywang henrywang added this to the 1.2.1 milestone Aug 23, 2026
@henrywang
henrywang merged commit 6ad8253 into main Aug 23, 2026
5 checks passed
@henrywang
henrywang deleted the 119-build-ssh-e2e-test branch August 23, 2026 02:07
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.

Add E2E test for Build sheet SSH agent forwarding

1 participant