Skip to content

✨ Harden Swift SDK package#252

Merged
Robdel12 merged 4 commits into
mainfrom
rd/audit-swift-sdk-build
May 12, 2026
Merged

✨ Harden Swift SDK package#252
Robdel12 merged 4 commits into
mainfrom
rd/audit-swift-sdk-build

Conversation

@Robdel12
Copy link
Copy Markdown
Contributor

@Robdel12 Robdel12 commented May 12, 2026

Why

The Swift SDK was doing the right high-level job, but its package shape made native app integration heavier than it needed to be. The core Vizzly product pulled in XCTest helpers, and Swift comparison options were sent at the top level even though the TDD server reads per-screenshot comparison settings from properties.

We also did not have the same real E2E confidence for Swift that the other SDKs have. A green unit test could still miss server discovery, actual PNG upload, local baseline creation, repeated screenshot matching, or the cloud CI path.

What changed

  • Split XCTest convenience APIs into a new VizzlyXCTest product while keeping the core Vizzly client lightweight.
  • Updated Swift screenshot payload construction so threshold, minClusterSize, and fullPage flow through properties, matching the server contract.
  • Added focused Swift tests for payload shaping and default server-config behavior.
  • Added VizzlyE2ETests, which upload real PNG bytes through VizzlyClient against a real local TDD server.
  • Added npm run test:swift:e2e, which builds the CLI, starts an isolated TDD run in a temp directory, and runs the Swift E2E suite.
  • Added the Swift SDK to .github/workflows/sdk-e2e.yml with both TDD-mode and cloud-mode runs.
  • Wired cloud-mode Swift E2E through the repo secret VIZZLY_SWIFT_CLIENT_TOKEN, matching the per-SDK token pattern used by the other SDKs.
  • Simplified the synchronous upload path with a small request-state helper for timeout/cancel handling.
  • Updated Swift SDK docs and examples for the SPM product split, E2E command, direct-client usage, and current integration guidance.

Validation

  • swift test
  • npm run test:swift:e2e
  • swift build --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.5.sdk --triple arm64-apple-ios13.0-simulator
  • swift package describe --type json
  • git diff --check
  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/sdk-e2e.yml"); puts "ok"'
  • Confirmed VIZZLY_SWIFT_CLIENT_TOKEN exists in repo Actions secrets.

Split XCTest helpers into their own product so native app targets can depend on the core client without test APIs. Align Swift screenshot payloads with the server comparison contract and document the SPM integration path.
@vizzly-testing

This comment has been minimized.

@Robdel12 Robdel12 marked this pull request as ready for review May 12, 2026 05:14
Run the Swift client against a real local Vizzly TDD server in an isolated temp workspace. Cover server discovery, PNG upload, new baseline creation, and repeated screenshot matching.
@vizzly-testing

This comment has been minimized.

Adds the Swift package to the shared SDK E2E GitHub Actions workflow with both local TDD and cloud-mode coverage, using the Swift-specific project token secret.
@vizzly-testing

This comment has been minimized.

Keeps the Swift E2E tests strict for TDD comparison metadata while accepting the leaner successful upload response returned by cloud mode.
@vizzly-testing
Copy link
Copy Markdown

vizzly-testing Bot commented May 12, 2026

Vizzly - Visual Test Results

CLI Reporter - Approved

19 comparisons, no changes detected.

View build

CLI TUI - Approved

5 comparisons, no changes detected.

View build


rd/audit-swift-sdk-build · 73e890b7

@Robdel12 Robdel12 merged commit c36e05a into main May 12, 2026
32 of 35 checks passed
@Robdel12 Robdel12 deleted the rd/audit-swift-sdk-build branch May 12, 2026 06:02
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