test: add E2E coverage for container filesystem export - #125
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Export Filesystem (#107) had unit coverage (mock
exportContainer) andmock UI coverage (menu enablement only —
ContextMenuTests), but nothingexercised 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 fromBerthlyE2ETests.swift, which is already near the 1400-line ratchet):writes a marker file into a container via
execbefore exporting, thenconfirms it's present in the produced archive via
tar -tf— proves thearchive 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'sSSH_AUTH_SOCKskip pattern.ComputeListView.exportFilesystem()calledNSSavePanel.runModal()directly with no test seam — same shape Save/Load had before
UITEST_SAVE_DESTINATION(ImageArchiveJourneyTests.swift's fileheader explains why a typed-path form isn't the right fix). Adds
UITEST_EXPORT_DESTINATION_DIR— a directory, not a single path, sincethis test exports two different containers within one app launch, each
landing at its own default filename.
Test plan
swiftlint lint --strict— 0 violationsBerthlyTests(unit) — full suite passes (no Core changes, regressioncheck only)
BerthlyUITests/ContextMenuTests— passes unchanged (regression check;export enablement logic untouched)
scripts/e2e.sh ExportJourneyTests/testExportFilesystemStoppedAndRunningagainst 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