Skip to content

Conversation

clindsay3
Copy link
Collaborator

Motivation

Certain screenshots in Emerge are flaky, and we suspect it might be because they are not using the codepaths setup explicitly for previews, to avoid doing things like network requests or accessing external resources.

Description

Adds a new extension on ProcessInfo called isRunningForPreviews that checks for both XCODE_RUNNING_FOR_PREVIEWS == "1" (set when running previews in Xcode) and EMERGE_IS_RUNNING_FOR_SNAPSHOTS == "1" (set when running on Emerge's screenshot servers). Update all references to XCODE_RUNNING_FOR_PREVIEWS to this new shared ProcessInfo extension.

@clindsay3 clindsay3 requested review from joshdholtz and a team July 22, 2025 22:17
Copy link

emerge-tools bot commented Jul 22, 2025

📸 Snapshot Test

2 modified, 703 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
0 0 1 0 234 0 ✅ Approved
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 235 0 N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
0 0 1 0 234 0 ✅ Approved

🛸 Powered by Emerge Tools

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Nice one! Perfect use of @_spi 👨‍🍳 👌

@clindsay3 clindsay3 merged commit 5928e61 into main Jul 23, 2025
12 checks passed
@clindsay3 clindsay3 deleted the test-env-variable branch July 23, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants