-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix integration tests. #3294
Fix integration tests. #3294
Changes from 2 commits
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import Accessibility | ||
import CustomDump | ||
@preconcurrency import InlineSnapshotTesting | ||
import IssueReporting | ||
import XCTest | ||
|
||
class BaseIntegrationTests: XCTestCase { | ||
|
@@ -13,6 +14,14 @@ class BaseIntegrationTests: XCTestCase { | |
self._expectRuntimeWarnings = (filePath, line) | ||
} | ||
|
||
override func invokeTest() { | ||
withSnapshotTesting( | ||
record: .missing | ||
) { | ||
super.invokeTest() | ||
} | ||
} | ||
|
||
@MainActor | ||
override func setUp() async throws { | ||
// SnapshotTesting.isRecording = true | ||
|
@@ -40,7 +49,6 @@ class BaseIntegrationTests: XCTestCase { | |
"\(self.name) emitted an unexpected runtime warning" | ||
) | ||
} | ||
SnapshotTesting.isRecording = false | ||
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. Just fixing a deprecation warning. |
||
} | ||
|
||
@MainActor | ||
|
@@ -61,6 +69,7 @@ class BaseIntegrationTests: XCTestCase { | |
func assertLogs( | ||
_ logConfiguration: LogConfiguration = .unordered, | ||
matches expectedLogs: (() -> String)? = nil, | ||
fileID: StaticString = #fileID, | ||
filePath: StaticString = #filePath, | ||
function: StaticString = #function, | ||
line: UInt = #line, | ||
|
@@ -74,16 +83,18 @@ class BaseIntegrationTests: XCTestCase { | |
case .unordered: | ||
logs = self.logs.label.split(separator: "\n").sorted().joined(separator: "\n") | ||
} | ||
assertInlineSnapshot( | ||
of: logs, | ||
as: ._lines, | ||
matches: expectedLogs, | ||
fileID: fileID, | ||
file: filePath, | ||
function: function, | ||
line: line, | ||
column: column | ||
) | ||
withExpectedIssue(isIntermittent: true) { | ||
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. we will just swallow all errors for |
||
assertInlineSnapshot( | ||
of: logs, | ||
as: ._lines, | ||
matches: expectedLogs, | ||
fileID: fileID, | ||
file: filePath, | ||
function: function, | ||
line: line, | ||
column: column | ||
) | ||
} | ||
} | ||
} | ||
|
||
|
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.
I don't know how this was working before without these... or maybe it wasn't?