forked from pointfreeco/swift-snapshot-testing
-
Notifications
You must be signed in to change notification settings - Fork 1
fix(macos): fix failing ci snapshots #3
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
Open
tillhainbach
wants to merge
44
commits into
main
Choose a base branch
from
fix-macos
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Avoid failing tests if system localisation uses a different decimal separator (e.g. "," for German region)
This avoids failing tests if host macOS is in dark mode.
…lorSpace Setting all three values allows for device independent snapshotting for macOS
To get CI test running with `recursiveDescription` the view size must be set explicitly.
e203a44
to
a8ca3ac
Compare
* Add Windows job to `ci.yml` * Add missing newline * Add name field to Windows job, format consistently * Add `os(Windows)` checks * Fix Windows tests * Fix Windows line endings * Use LF line endings for git checkout on Windows
* Update package name * wip
* Added `Snapshotting.json` for `Any` value Currently the only way to snapshot `Any` value is using `dump`. However, the format isn't always as readable as it can be. For data that can be encoded in JSON, this new overload provides a much more readable output. * Fixed macOS build `.sortedKeys` is only available from `macOS 10.13`. * Public extension
OpenGL types have been marked as deprecated starting with iOS 12, so if you compile SnapshotTesting with a minimum OS target version of iOS 12 or higher, you get the following compiler warning: ``` SnapshotTesting/Sources/SnapshotTesting/Common/View.swift:585:31: error: 'GLKView' was deprecated in iOS 12.0: OpenGLES API deprecated. (Define GLES_SILENCE_DEPRECATION to silence these warnings) if let glkView = self as? GLKView { ^ ``` Because Swift has no mechanism to silence deprecation warnings, I propose removing snapshotting support for `GLKView`. Users of Snapshotting can still maintain support for snapshotting `GLKView`s with a custom snapshot strategy.
When running with host application, rootViewController is retained by the window, and it retains the view controller we are testing (which is a child view controller). This causes a leak on the view controller we're testing. By removing the view controller from it's parent, no one retains the view controller, fixing the leak.
* Add an optional perceptualPrecision parameter for image snapshot comparisons The perceptual precision number is between 0 & 1 that gets translated to a CIE94 tolerance https://en.wikipedia.org/wiki/Color_difference * Use CIColorThreshold and CIAreaAverage for a 70% faster image diff on iOS 14, tvOS 14, and macOS 11 * Add a unit test demonstrating the difference between pixel precision and perceptual precision * Update the reference image for the image precision test * Backport the threshold filter to macOS 10.13 by creating a CIImageProcessorKernel implementation * Update Sources/SnapshotTesting/Snapshotting/UIImage.swift * Update NSImage.swift Co-authored-by: Stephen Celis <[email protected]> Co-authored-by: Stephen Celis <[email protected]>
Co-authored-by: Stephen Celis <[email protected]>
* Modernize Project Getting the project into some modern order before next release. * Update ci.yml * Update ci.yml * wip * wip * wip * Update ci.yml
…on fails to match (pointfreeco#638)
* Require Swift 5.5+ * wip * wip
* Add SnapshotTestingHEIC to plugins list * Fix README
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
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.
No description provided.