Skip to content

Examples of Extracting Previews via SnapshotPreviews on github runner#751

Open
NicoHinderling wants to merge 9 commits intomainfrom
test-snapshots-ci
Open

Examples of Extracting Previews via SnapshotPreviews on github runner#751
NicoHinderling wants to merge 9 commits intomainfrom
test-snapshots-ci

Conversation

@NicoHinderling
Copy link
Contributor

@NicoHinderling NicoHinderling commented Mar 3, 2026

Two examples in this:

  1. Ultra simple .github/workflows/ios_sentry_upload_snapshots.yml: just the bare bones
  2. .github/workflows/ios_sentry_upload_snapshots_with_script.yml + the new script and the config file: An attempt with Claude's help to create a crude version of a reusable script with some of the benefits we only had within the emerge backend code (see comments at top of flie in .github/scripts/ios/emerge-snapshots)

@emerge-tools
Copy link

emerge-tools bot commented Mar 3, 2026

📸 Snapshot Test

2 modified, 70 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
HackerNews
com.emergetools.hackernews.snapshots
0 0 2 0 70 0 ⏳ Needs approval

🛸 Powered by Emerge Tools

@NicoHinderling NicoHinderling changed the title Test snapshots ci Examples of Extracting Previews via SnapshotPreviews on github runner Mar 19, 2026
return $exit_code
}

collect_crash_reports() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still necessary now that the run is backed by xcodebuild? IIRC the generated test report file will show you where the crash occurred. The way you do it here was always pretty flaky for us so I'd rather just kill this entirely and lean on the supported methods (xcodebuild)

return $count
}

extract_images() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively we could add an env variable to the test runner to have it write the images to a directory. IIRC from some initial testing that was about a minute faster for our biggest user. Because when we write the images to a file ourselves that can be done async rather than blocking the main queue

# attempt numbers, and any captured crash report filenames
#
# Potential follow-ups (not yet implemented):
# - Regex-based exclusion filtering: filter extracted PNGs by filename pattern before
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should all be done using the XCTest, it already supports that. In other words we don't want people to do this twice: once for this script and once for running locally. We should just standardize on the Swift way

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.

2 participants