Turn off failing XCTest attachment collection (flutter/engine#19668)

This commit is contained in:
Jenn Magder
2020-07-14 09:06:03 -07:00
committed by GitHub
parent d84cfd7173
commit 1aa5f8cd66
3 changed files with 20 additions and 14 deletions

View File

@@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
systemAttachmentLifetime = "keepNever">
<Testables>
<TestableReference
skipped = "NO">

View File

@@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
systemAttachmentLifetime = "keepNever">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"

View File

@@ -48,22 +48,26 @@ static const NSInteger kSecondsToWaitForPlatformView = 30;
GoldenImage* golden = self.manager.goldenImage;
XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot];
XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot];
attachment.name = @"new_golden";
attachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:attachment];
if (golden.image) {
XCTAttachment* goldenAttachment = [XCTAttachment attachmentWithImage:golden.image];
attachment.name = @"current_golden";
goldenAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:goldenAttachment];
} else {
if (!golden.image) {
XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot];
attachment.name = @"new_golden";
attachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:attachment];
XCTFail(@"This test will fail - no golden named %@ found. Follow the steps in the "
@"README to add a new golden.",
golden.goldenName);
}
XCTAssertTrue([golden compareGoldenToImage:screenshot.image]);
if (![golden compareGoldenToImage:screenshot.image]) {
XCTAttachment* goldenAttachment;
goldenAttachment = [XCTAttachment attachmentWithImage:golden.image];
goldenAttachment.name = @"current_golden";
goldenAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:goldenAttachment];
XCTFail(@"Goldens to not match. Follow the steps in the "
@"README to update golden named %@ if needed.",
golden.goldenName);
}
}
@end