Skip to content

test: add E2E coverage for container filesystem export - #125

Merged
henrywang merged 1 commit into
mainfrom
122-export-e2e-test
Aug 23, 2026
Merged

test: add E2E coverage for container filesystem export#125
henrywang merged 1 commit into
mainfrom
122-export-e2e-test

Conversation

@henrywang

Copy link
Copy Markdown
Owner

Summary

Export Filesystem (#107) had unit coverage (mock exportContainer) and
mock UI coverage (menu enablement only — ContextMenuTests), but nothing
exercised it against a real daemon: not the pre-existing stopped-container
path, and not the running-container path gated behind
ContainerCompatibility.isAtLeast(installed:, "1.2.1").

Changes

  • ExportJourneyTests.swift (new file — kept separate from
    BerthlyE2ETests.swift, which is already near the 1400-line ratchet):
    writes a marker file into a container via exec before exporting, then
    confirms it's present in the produced archive via tar -tf — proves the
    archive is genuinely correct, not just that a file landed on disk. Covers
    both the stopped path (always allowed) and the running path (gated); the
    running half XCTSkips cleanly on a pre-1.2.1 daemon rather than failing,
    matching testBuildWithSSHForwardingMountsAgentSocket's
    SSH_AUTH_SOCK skip pattern.
  • ComputeListView.exportFilesystem() called NSSavePanel.runModal()
    directly with no test seam — same shape Save/Load had before
    UITEST_SAVE_DESTINATION (ImageArchiveJourneyTests.swift's file
    header explains why a typed-path form isn't the right fix). Adds
    UITEST_EXPORT_DESTINATION_DIR — a directory, not a single path, since
    this test exports two different containers within one app launch, each
    landing at its own default filename.

Test plan

  • swiftlint lint --strict — 0 violations
  • BerthlyTests (unit) — full suite passes (no Core changes, regression
    check only)
  • BerthlyUITests/ContextMenuTests — passes unchanged (regression check;
    export enablement logic untouched)
  • scripts/e2e.sh ExportJourneyTests/testExportFilesystemStoppedAndRunning
    against the real local daemon (now upgraded to 1.2.2 via No in-app path to update container across patch versions #123) — passes
    genuinely, not skipped
    : both the stopped and running export paths ran
    for real, and both archives were confirmed to contain their marker file

Fixes #122

Export Filesystem (#107) had unit coverage (mock exportContainer) and mock
UI coverage (menu enablement only), but nothing exercised it against a real
daemon — neither the pre-existing stopped-container path nor the
running-container path gated behind ContainerCompatibility.isAtLeast(1.2.1).

Adds ExportJourneyTests, covering both: a marker file written into the
container via exec before export, confirmed present in the produced
archive via `tar -tf` afterward — proves the archive is genuinely correct,
not just present on disk. The running-container half skips cleanly on a
pre-1.2.1 daemon rather than failing.

exportFilesystem() called NSSavePanel.runModal() directly with no test
seam (same shape Save/Load had before UITEST_SAVE_DESTINATION) — adds
UITEST_EXPORT_DESTINATION_DIR, a directory rather than a single path since
this test exports two different containers in one app launch.

Fixes #122
@henrywang henrywang added this to the 1.2.1 milestone Aug 23, 2026
@henrywang
henrywang merged commit 473af34 into main Aug 23, 2026
9 of 10 checks passed
@henrywang
henrywang deleted the 122-export-e2e-test branch August 23, 2026 16:17
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 running/stopped container filesystem export

1 participant