-
Notifications
You must be signed in to change notification settings - Fork 70
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
Update workflow with macOS 11 #104
Changes from 24 commits
8811743
c6aff61
550db8b
21760e6
b5ac528
0f75164
9137a41
5dbd2de
ca8d757
4bfe4c3
8151b5f
4a44f17
5c3dd44
2469310
5de1fa1
44258bb
7b76b50
5eb0fab
62fc9cb
93b04ae
ad4d8f9
f34c1aa
e39e76b
1b5a2d4
24095b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Copyright 2022 Square Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public class LocalTestsConstants: NSObject { | ||
|
||
/** | ||
This float ranges from 0 to 1 and will be used to calculate how precise a snapshot test will be, | ||
where 1 means all pixels should match, and 0 means that none of them need to match. | ||
*/ | ||
static public let testPrecision: CGFloat = 0.9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 90% seems pretty low... does it need to be this low to pass, or can we be stricter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good catch. It was a type, but I haven't tested with other numbers. Let's try 98% to see how it goes. |
||
|
||
/** | ||
In these local tests, we will use test precision to calculate pixel tolerance. | ||
*/ | ||
static public var perPixelTolerance: CGFloat { | ||
return 1.0 - testPrecision | ||
} | ||
|
||
/** | ||
Used to activate or deactivate record mode. If active, new snapshots will be recorded/saved for | ||
those thats that are run. | ||
*/ | ||
static public let isRecordMode: Bool = false | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,8 +44,9 @@ class SnapshotTestCase: FBSnapshotTestCase { | |
// MARK: - Private Static Properties | ||
|
||
private static let testedDevices = [ | ||
TestDeviceConfig(systemVersion: "14.2", screenSize: CGSize(width: 390, height: 844), screenScale: 3), | ||
TestDeviceConfig(systemVersion: "13.3", screenSize: CGSize(width: 375, height: 812), screenScale: 3), | ||
TestDeviceConfig(systemVersion: "15.2", screenSize: CGSize(width: 390, height: 844), screenScale: 3), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran the tests locally and it looks like you're missing a bunch of reference images for 15.2. If we're going to add 15.2 support here, we need to have a matching CI build to verify it. This PR is getting quite large, though, so I think it's worth splitting out adding 15.2 into a separate change. |
||
TestDeviceConfig(systemVersion: "14.5", screenSize: CGSize(width: 390, height: 844), screenScale: 3), | ||
TestDeviceConfig(systemVersion: "13.7", screenSize: CGSize(width: 375, height: 812), screenScale: 3), | ||
TestDeviceConfig(systemVersion: "12.4", screenSize: CGSize(width: 375, height: 812), screenScale: 3), | ||
] | ||
|
||
|
@@ -68,7 +69,7 @@ class SnapshotTestCase: FBSnapshotTestCase { | |
|
||
fileNameOptions = [.OS, .screenSize, .screenScale] | ||
|
||
recordMode = false | ||
recordMode = LocalTestsConstants.isRecordMode | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this
~> 1.9
now, since we don't need to pin to a specific version?