Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve warning about view snapshot discrepancies #592

Merged
merged 1 commit into from
Sep 21, 2022
Merged

Improve warning about view snapshot discrepancies #592

merged 1 commit into from
Sep 21, 2022

Conversation

gohanlon
Copy link
Contributor

@gohanlon gohanlon commented Apr 3, 2022

I think it's better to be conservative, as the list of variables that can cause discrepancies is incomplete and unlikely to ever be exhaustive.

Other things that seem to cause differences:

  • The architecture of the Mac running the simulator causing subtle "sub" pixel differences
  • Optical font sizing adjustments that either don't respect the displayScale UI trait or deliberately ignore it because it's truly driven by the device display's points per inch (a product of the display's scale and pixels per inch)
  • Changes to system fonts between iOS versions (lose fit, but added to emphasize the need for a snapshot strategy to be run on multiple devices, unless only one iOS version is targeted)

I think a broad caution is more prudent than extending the warning to include more device characteristics, as even if that list could be complete now, it would be very hard to track.

I think it's better to be conservative, as the list of variables that can cause discrepancies is incomplete and unlikely to ever be exhaustive.

Other things that seem to cause differences are the architecture of the Mac running the simulator causing subtle "sub" pixel differences, and optical font sizing adjustments that either don't respect the `displayScale` UI trait or deliberately ignore it because it's truly driven by the device display's points per inch (a product of the display's scale and pixels per inch).

I think a broad caution is more prudent than extending the warning to include more device characteristics, as even if that list could be complete now, it would be very hard to track.
@gohanlon
Copy link
Contributor Author

gohanlon commented Apr 4, 2022

More alternatives, same as the proposed in this PR but removing the emphatic/redundant "exact":

⚠️ Warning: Snapshots must be compared using the same simulator that originally took the reference to avoid discrepancies between images.

Strengthened to also mention the architecture of the hosting Mac:

⚠️ Warning: To avoid discrepancies between images, snapshots must be compared using the same simulator and Mac system architecture (i.e. Apple Silicon vs. Intel) that originally took the reference image.

@stephencelis stephencelis merged commit ea9bc1b into pointfreeco:main Sep 21, 2022
niil-qb pushed a commit to quickbit/swift-snapshot-testing that referenced this pull request Feb 23, 2023
I think it's better to be conservative, as the list of variables that can cause discrepancies is incomplete and unlikely to ever be exhaustive.

Other things that seem to cause differences are the architecture of the Mac running the simulator causing subtle "sub" pixel differences, and optical font sizing adjustments that either don't respect the `displayScale` UI trait or deliberately ignore it because it's truly driven by the device display's points per inch (a product of the display's scale and pixels per inch).

I think a broad caution is more prudent than extending the warning to include more device characteristics, as even if that list could be complete now, it would be very hard to track.
Muhieddine-El-Kaissi pushed a commit to thumbtack/swift-snapshot-testing that referenced this pull request Aug 8, 2024
I think it's better to be conservative, as the list of variables that can cause discrepancies is incomplete and unlikely to ever be exhaustive.

Other things that seem to cause differences are the architecture of the Mac running the simulator causing subtle "sub" pixel differences, and optical font sizing adjustments that either don't respect the `displayScale` UI trait or deliberately ignore it because it's truly driven by the device display's points per inch (a product of the display's scale and pixels per inch).

I think a broad caution is more prudent than extending the warning to include more device characteristics, as even if that list could be complete now, it would be very hard to track.
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