diff --git a/src/Microsoft.DotNet.XHarness.Apple/ErrorKnowledgeBase.cs b/src/Microsoft.DotNet.XHarness.Apple/ErrorKnowledgeBase.cs index e856a5f3b..f0f1caa03 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/ErrorKnowledgeBase.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/ErrorKnowledgeBase.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; +using Microsoft.DotNet.XHarness.Common.CLI; using Microsoft.DotNet.XHarness.Common.Logging; using Microsoft.DotNet.XHarness.iOS.Shared; @@ -13,61 +14,68 @@ namespace Microsoft.DotNet.XHarness.Apple { public class ErrorKnowledgeBase : IErrorKnowledgeBase { - private static readonly Dictionary s_testErrorMaps = new() + private static readonly Dictionary s_testErrorMaps = new() { - ["Failed to communicate with the device"] = // Known issue but not a failure. - ("Failed to communicate with the device. Please ensure the cable is properly connected, and try rebooting the device", null), + ["Failed to communicate with the device"] = + new("Failed to communicate with the device. Please ensure the cable is properly connected, and try rebooting the device", + suggestedExitCode: (int)ExitCode.DEVICE_FAILURE), ["MT1031"] = - ("Cannot launch the application because the device is locked. Please unlock the device and try again", null), + new("Cannot launch the application because the device is locked. Please unlock the device and try again", + suggestedExitCode: (int)ExitCode.DEVICE_FAILURE), ["the device is locked"] = - ("Cannot launch the application because the device is locked. Please unlock the device and try again", null), + new("Cannot launch the application because the device is locked. Please unlock the device and try again", + suggestedExitCode: (int)ExitCode.DEVICE_FAILURE), ["while Setup Assistant is running"] = - ("Cannot launch the application because the device's update hasn't been finished. The setup assistant is still running. Please finish the device OS update on the device", null), + new("Cannot launch the application because the device's update hasn't been finished. The setup assistant is still running. Please finish the device OS update on the device", + suggestedExitCode: (int)ExitCode.DEVICE_FAILURE), ["LSOpenURLsWithRole() failed with error -10825"] = - ("This application requires a newer version of MacOS", null), + new("This application requires a newer version of MacOS", + suggestedExitCode: (int)ExitCode.GENERAL_FAILURE), + + ["HE0018: Could not launch the simulator application"] = + new("Failed to launch the Simulator application. Please reboot the computer and try again", + suggestedExitCode: (int)ExitCode.SIMULATOR_FAILURE), }; - private static readonly Dictionary s_buildErrorMaps = new(); + private static readonly Dictionary s_buildErrorMaps = new(); - private static readonly Dictionary s_installErrorMaps = new() + private static readonly Dictionary s_installErrorMaps = new() { ["IncorrectArchitecture"] = - ("IncorrectArchitecture: Failed to find matching device arch for the application", null), // known failure, but not an issue + new("IncorrectArchitecture: Failed to find matching device arch for the application"), // known failure, but not an issue ["0xe8008015"] = - ("No valid provisioning profile found", null), + new("No valid provisioning profile found", suggestedExitCode: (int)ExitCode.APP_NOT_SIGNED), ["valid provisioning profile for this executable was not found"] = - ("No valid provisioning profile found", null), + new("No valid provisioning profile found", suggestedExitCode: (int)ExitCode.APP_NOT_SIGNED), ["0xe800801c"] = - ("App is not signed", null), + new("App is not signed", suggestedExitCode: (int)ExitCode.APP_NOT_SIGNED), ["No code signature found"] = - ("App is not signed", null), + new("App is not signed", suggestedExitCode: (int)ExitCode.APP_NOT_SIGNED), + + ["HE0018: Could not launch the simulator application"] = + new("Failed to launch the Simulator application", + suggestedExitCode: (int)ExitCode.SIMULATOR_FAILURE), }; - public bool IsKnownBuildIssue(IFileBackedLog buildLog, - [NotNullWhen(true)] - out (string HumanMessage, string? IssueLink)? knownFailureMessage) + public bool IsKnownBuildIssue(IFileBackedLog buildLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage) => TryFindErrors(buildLog, s_buildErrorMaps, out knownFailureMessage); - public bool IsKnownTestIssue(IFileBackedLog runLog, - [NotNullWhen(true)] - out (string HumanMessage, string? IssueLink)? knownFailureMessage) + public bool IsKnownTestIssue(IFileBackedLog runLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage) => TryFindErrors(runLog, s_testErrorMaps, out knownFailureMessage); - public bool IsKnownInstallIssue(IFileBackedLog installLog, - [NotNullWhen(true)] - out (string HumanMessage, string? IssueLink)? knownFailureMessage) + public bool IsKnownInstallIssue(IFileBackedLog installLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage) => TryFindErrors(installLog, s_installErrorMaps, out knownFailureMessage); - private static bool TryFindErrors(IFileBackedLog log, Dictionary errorMap, - [NotNullWhen(true)] out (string HumanMessage, string? IssueLink)? failureMessage) + private static bool TryFindErrors(IFileBackedLog log, Dictionary errorMap, + [NotNullWhen(true)] out KnownIssue? failureMessage) { failureMessage = null; if (log == null) diff --git a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/BaseOrchestrator.cs b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/BaseOrchestrator.cs index 6f4692e67..42a7ab6de 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/BaseOrchestrator.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/BaseOrchestrator.cs @@ -108,13 +108,19 @@ protected async Task OrchestrateRun( catch (Exception e) { var message = new StringBuilder().AppendLine("Application run failed:"); + exitCode = ExitCode.APP_LAUNCH_FAILURE; - if (_errorKnowledgeBase.IsKnownTestIssue(_mainLog, out var failureMessage)) + if (_errorKnowledgeBase.IsKnownTestIssue(_mainLog, out var failure)) { - message.Append(failureMessage.Value.HumanMessage); - if (failureMessage.Value.IssueLink != null) + message.Append(failure.HumanMessage); + if (failure.IssueLink != null) { - message.AppendLine($" Find more information at {failureMessage.Value.IssueLink}"); + message.AppendLine($" Find more information at {failure.IssueLink}"); + } + + if (failure.SuggestedExitCode.HasValue) + { + exitCode = (ExitCode)failure.SuggestedExitCode.Value; } } else @@ -124,7 +130,7 @@ protected async Task OrchestrateRun( _logger.LogError(message.ToString()); - return ExitCode.APP_LAUNCH_FAILURE; + return exitCode; } } @@ -195,14 +201,21 @@ protected async Task OrchestrateRun( } catch (Exception e) { + exitCode = ExitCode.APP_LAUNCH_FAILURE; + var message = new StringBuilder().AppendLine("Application run failed:"); - if (_errorKnowledgeBase.IsKnownTestIssue(_mainLog, out var failureMessage)) + if (_errorKnowledgeBase.IsKnownTestIssue(_mainLog, out var failure)) { - message.Append(failureMessage.Value.HumanMessage); - if (failureMessage.Value.IssueLink != null) + message.Append(failure.HumanMessage); + if (failure.IssueLink != null) { - message.AppendLine($" Find more information at {failureMessage.Value.IssueLink}"); + message.AppendLine($" Find more information at {failure.IssueLink}"); + } + + if (failure.SuggestedExitCode.HasValue) + { + exitCode = (ExitCode)failure.SuggestedExitCode.Value; } } else @@ -211,8 +224,6 @@ protected async Task OrchestrateRun( } _logger.LogError(message.ToString()); - - exitCode = ExitCode.APP_LAUNCH_FAILURE; } finally { @@ -272,19 +283,26 @@ protected virtual async Task InstallApp( return ExitCode.PACKAGE_INSTALLATION_TIMEOUT; } + var exitCode = ExitCode.PACKAGE_INSTALLATION_FAILURE; + // use the knowledge base class to decide if the error is known, if it is, let the user know // the failure reason - if (_errorKnowledgeBase.IsKnownInstallIssue(_mainLog, out var errorMessage)) + if (_errorKnowledgeBase.IsKnownInstallIssue(_mainLog, out var failure)) { var error = new StringBuilder() .AppendLine("Failed to install the application") - .AppendLine(errorMessage.Value.HumanMessage); + .AppendLine(failure.HumanMessage); - if (errorMessage.Value.IssueLink != null) + if (failure.IssueLink != null) { error .AppendLine() - .AppendLine($" Find more information at {errorMessage.Value.IssueLink}"); + .AppendLine($" Find more information at {failure.IssueLink}"); + } + + if (failure.SuggestedExitCode.HasValue) + { + exitCode = (ExitCode)failure.SuggestedExitCode.Value; } _logger.LogError(error.ToString()); @@ -294,7 +312,7 @@ protected virtual async Task InstallApp( _logger.LogError($"Failed to install the application"); } - return ExitCode.PACKAGE_INSTALLATION_FAILURE; + return exitCode; } _logger.LogInformation($"Application '{appBundleInfo.AppName}' was installed successfully on '{device.Name}'"); diff --git a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/InstallOrchestrator.cs b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/InstallOrchestrator.cs index 0422912fe..17a618e6d 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/InstallOrchestrator.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/InstallOrchestrator.cs @@ -66,7 +66,17 @@ public async Task OrchestrateInstall( CancellationToken cancellationToken) { _consoleLogger.LogInformation($"Getting app bundle information from '{appPackagePath}'"); - var appBundleInfo = await _appBundleInformationParser.ParseFromAppBundle(appPackagePath, target.Platform, _mainLog, cancellationToken); + + AppBundleInformation appBundleInfo; + try + { + appBundleInfo = await _appBundleInformationParser.ParseFromAppBundle(appPackagePath, target.Platform, _mainLog, cancellationToken); + } + catch (Exception e) + { + _consoleLogger.LogError(e.Message); + return ExitCode.FAILED_TO_GET_BUNDLE_INFO; + } Func> executeMacCatalystApp = (appBundleInfo) => throw new InvalidOperationException("install command not available on maccatalyst"); diff --git a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs index b752886ee..453db08ad 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs @@ -256,16 +256,24 @@ private ExitCode ParseResult( if (expectedExitCode != exitCode) { _logger.LogError($"Application has finished with exit code {exitCode} but {expectedExitCode} was expected"); + var cliExitCode = ExitCode.GENERAL_FAILURE; foreach (var log in _logs) { - if (_errorKnowledgeBase.IsKnownTestIssue(log, out var failureMessage)) + if (_errorKnowledgeBase.IsKnownTestIssue(log, out var failure)) { - _logger.LogError(failureMessage.Value.HumanMessage); + _logger.LogError(failure.HumanMessage); + + if (failure.SuggestedExitCode.HasValue) + { + cliExitCode = (ExitCode)failure.SuggestedExitCode.Value; + } + + break; } } - return ExitCode.GENERAL_FAILURE; + return cliExitCode; } _logger.LogInformation("Application has finished with exit code: " + exitCode + diff --git a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/TestOrchestrator.cs b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/TestOrchestrator.cs index dabdf04f5..6e842ba96 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/TestOrchestrator.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/TestOrchestrator.cs @@ -274,14 +274,14 @@ private ExitCode ParseResult(TestExecutingResult testResult, string resultMessag string newLine = Environment.NewLine; const string checkLogsMessage = "Check logs for more information"; - void LogProblem(string message) + ExitCode LogProblem(string message, ExitCode defaultExitCode) { foreach (var log in _logs) { if (_errorKnowledgeBase.IsKnownTestIssue(log, out var issue)) { - _logger.LogError(message + newLine + issue.Value.HumanMessage); - return; + _logger.LogError(message + newLine + issue.HumanMessage); + return issue.SuggestedExitCode.HasValue ? (ExitCode)issue.SuggestedExitCode.Value : defaultExitCode; } } @@ -293,6 +293,8 @@ void LogProblem(string message) { _logger.LogError(message + newLine + checkLogsMessage); } + + return defaultExitCode; } switch (testResult) @@ -308,12 +310,10 @@ void LogProblem(string message) return ExitCode.TESTS_FAILED; case TestExecutingResult.LaunchFailure: - LogProblem("Failed to launch the application"); - return ExitCode.APP_LAUNCH_FAILURE; + return LogProblem("Failed to launch the application", ExitCode.APP_LAUNCH_FAILURE); case TestExecutingResult.Crashed: - LogProblem("Application test run crashed"); - return ExitCode.APP_CRASH; + return LogProblem("Application test run crashed", ExitCode.APP_LAUNCH_FAILURE); case TestExecutingResult.TimedOut: _logger.LogWarning($"Application test run timed out"); diff --git a/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleRunCommand.cs b/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleRunCommand.cs index 84cbb8924..6c8a3dc1d 100644 --- a/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleRunCommand.cs +++ b/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleRunCommand.cs @@ -38,11 +38,21 @@ protected override async Task InvokeInternal(ServiceProvider servicePr var mainLog = serviceProvider.GetRequiredService(); var appBundleInformationParser = serviceProvider.GetRequiredService(); - var appBundleInfo = await appBundleInformationParser.ParseFromAppBundle( - Arguments.AppBundlePath.Value ?? throw new ArgumentException("App bundle path not provided"), - Arguments.Target.Value.Platform, - mainLog, - cancellationToken); + + AppBundleInformation appBundleInfo; + try + { + appBundleInfo = await appBundleInformationParser.ParseFromAppBundle( + Arguments.AppBundlePath.Value ?? throw new ArgumentException("App bundle path not provided"), + Arguments.Target.Value.Platform, + mainLog, + cancellationToken); + } + catch (Exception e) + { + logger.LogError(e.Message); + return ExitCode.FAILED_TO_GET_BUNDLE_INFO; + } var orchestrator = serviceProvider.GetRequiredService(); return await orchestrator.OrchestrateRun( diff --git a/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleTestCommand.cs b/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleTestCommand.cs index 06b893ebd..1793e72f6 100644 --- a/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleTestCommand.cs +++ b/src/Microsoft.DotNet.XHarness.CLI/Commands/Apple/AppleTestCommand.cs @@ -38,7 +38,21 @@ protected override async Task InvokeInternal(ServiceProvider servicePr var mainLog = serviceProvider.GetRequiredService(); var appBundleInformationParser = serviceProvider.GetRequiredService(); - var appBundleInfo = await appBundleInformationParser.ParseFromAppBundle(Arguments.AppBundlePath.Value ?? throw new ArgumentException("App bundle path not set"), Arguments.Target.Value.Platform, mainLog, cancellationToken); + + AppBundleInformation appBundleInfo; + try + { + appBundleInfo = await appBundleInformationParser.ParseFromAppBundle( + Arguments.AppBundlePath.Value ?? throw new ArgumentException("App bundle path not provided"), + Arguments.Target.Value.Platform, + mainLog, + cancellationToken); + } + catch (Exception e) + { + logger.LogError(e.Message); + return ExitCode.FAILED_TO_GET_BUNDLE_INFO; + } var orchestrator = serviceProvider.GetRequiredService(); diff --git a/src/Microsoft.DotNet.XHarness.Common/CLI/ExitCode.cs b/src/Microsoft.DotNet.XHarness.Common/CLI/ExitCode.cs index f223e5e7e..453ee5f3c 100644 --- a/src/Microsoft.DotNet.XHarness.Common/CLI/ExitCode.cs +++ b/src/Microsoft.DotNet.XHarness.Common/CLI/ExitCode.cs @@ -36,25 +36,74 @@ public enum ExitCode /// PACKAGE_NOT_FOUND = 4, - #region General failures - + /// + /// Time out based on the --timeout or --launch-timeout settings + /// TIMED_OUT = 70, - GENERAL_FAILURE = 71, - - #endregion - #region Running the test package + /// + /// Generic code for cases where we couldn't determine the exact cause + /// + GENERAL_FAILURE = 71, + /// + /// App installation failed + /// PACKAGE_INSTALLATION_FAILURE = 78, + + /// + /// Failed to open/parse Info.plist inside of the app bundle + /// FAILED_TO_GET_BUNDLE_INFO = 79, + + /// + /// The app was launched but we never heard from it and similar cases + /// APP_CRASH = 80, + + /// + /// XHarness failed to find a suitable target for the test + /// DEVICE_NOT_FOUND = 81, + + /// + /// Various scenarios that depend on an exit code which was not returned + /// RETURN_CODE_NOT_SET = 82, + + /// + /// An error occurred when trying to launch the application + /// APP_LAUNCH_FAILURE = 83, + + /// + /// Failed to retrieve a file from the Android device/emulator + /// DEVICE_FILE_COPY_FAILURE = 84, + + /// + /// Failed to retrieve a list of Android targets via ADB + /// ADB_DEVICE_ENUMERATION_FAILURE = 85, + + /// + /// Time outs happening during the installation phase (or install command) + /// PACKAGE_INSTALLATION_TIMEOUT = 86, - #endregion + /// + /// Apple app is not signed, provisioning profile is missing and similar + /// + APP_NOT_SIGNED = 87, + + /// + /// Failed to start simulator (happens every now and then on MacOS mostly) + /// + SIMULATOR_FAILURE = 88, + + /// + /// Hardware device is in some corrupted state, or just locked screen + /// + DEVICE_FAILURE = 89, } } diff --git a/src/Microsoft.DotNet.XHarness.iOS.Shared/IErrorKnowledgeBase.cs b/src/Microsoft.DotNet.XHarness.iOS.Shared/IErrorKnowledgeBase.cs index 818b39655..893059dde 100644 --- a/src/Microsoft.DotNet.XHarness.iOS.Shared/IErrorKnowledgeBase.cs +++ b/src/Microsoft.DotNet.XHarness.iOS.Shared/IErrorKnowledgeBase.cs @@ -2,10 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable using System.Diagnostics.CodeAnalysis; using Microsoft.DotNet.XHarness.Common.Logging; +#nullable enable namespace Microsoft.DotNet.XHarness.iOS.Shared { /// @@ -20,7 +20,7 @@ public interface IErrorKnowledgeBase /// The installation log. /// A string message for the user to understand the reason for the failure. /// True if the failure is due to a known reason, false otherwise. - bool IsKnownInstallIssue(IFileBackedLog installLog, [NotNullWhen(true)] out (string HumanMessage, string? IssueLink)? knownFailureMessage); + bool IsKnownInstallIssue(IFileBackedLog installLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage); /// /// Identifies via the logs if the build failure is due to a known issue that the user can act upon. @@ -28,7 +28,7 @@ public interface IErrorKnowledgeBase /// The build log. /// A string message for the user to understand the reason for the failure. /// True if the failure is due to a known reason, false otherwise. - bool IsKnownBuildIssue(IFileBackedLog buildLog, [NotNullWhen(true)] out (string HumanMessage, string? IssueLink)? knownFailureMessage); + bool IsKnownBuildIssue(IFileBackedLog buildLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage); /// /// Identifies via the logs if the run failure is due to a known issue that the user can act upon. @@ -36,6 +36,31 @@ public interface IErrorKnowledgeBase /// The run log. /// A string message for the user to understand the reason for the failure. /// True if the failure is due to a known reason, false otherwise. - bool IsKnownTestIssue(IFileBackedLog runLog, [NotNullWhen(true)] out (string HumanMessage, string? IssueLink)? knownFailureMessage); + bool IsKnownTestIssue(IFileBackedLog runLog, [NotNullWhen(true)] out KnownIssue? knownFailureMessage); + } + + public class KnownIssue + { + /// + /// Human readable message that can be presented to the user. + /// + public string HumanMessage { get; } + + /// + /// Link to an issue where this problem is being handled. + /// + public string? IssueLink { get; } + + /// + /// Suggested exit code + /// + public int? SuggestedExitCode { get; } + + public KnownIssue(string humanMessage, string? issueLink = null, int? suggestedExitCode = null) + { + HumanMessage = humanMessage; + IssueLink = issueLink; + SuggestedExitCode = suggestedExitCode; + } } } diff --git a/tests/Microsoft.DotNet.XHarness.Apple.Tests/ErrorKnowledgeBaseTests.cs b/tests/Microsoft.DotNet.XHarness.Apple.Tests/ErrorKnowledgeBaseTests.cs index f5b510e2a..2ecef531b 100644 --- a/tests/Microsoft.DotNet.XHarness.Apple.Tests/ErrorKnowledgeBaseTests.cs +++ b/tests/Microsoft.DotNet.XHarness.Apple.Tests/ErrorKnowledgeBaseTests.cs @@ -42,8 +42,8 @@ public void WrongArchPresentTest() "IncorrectArchitecture: Failed to find matching arch for 64-bit Mach-O input file /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.Ic8Ank/extracted/monotouchtest.app/monotouchtest"); log.Flush(); - Assert.True(_errorKnowledgeBase.IsKnownInstallIssue(log, out var failureMessage)); - Assert.Equal(expectedFailureMessage, failureMessage.Value.HumanMessage); + Assert.True(_errorKnowledgeBase.IsKnownInstallIssue(log, out var failure)); + Assert.Equal(expectedFailureMessage, failure.HumanMessage); } } @@ -61,8 +61,8 @@ public void WrongArchNotPresentTest() log.WriteLine("Status: VerifyingApplication"); log.Flush(); - Assert.False(_errorKnowledgeBase.IsKnownInstallIssue(log, out var failureMessage)); - Assert.Null(failureMessage); + Assert.False(_errorKnowledgeBase.IsKnownInstallIssue(log, out var failure)); + Assert.Null(failure); } } @@ -82,8 +82,8 @@ public void UsbIssuesPresentTest() log.WriteLine("Xamarin.Hosting.MobileDeviceException: Failed to communicate with the device. Please ensure the cable is properly connected, and try rebooting the device (error: 0xe8000065 kAMDMuxConnectError)"); log.Flush(); - Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failureMessage)); - Assert.Equal(expectedFailureMessage, failureMessage.Value.HumanMessage); + Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failure)); + Assert.Equal(expectedFailureMessage, failure.HumanMessage); } } @@ -100,8 +100,8 @@ public void UsbIssuesMissingTest() log.WriteLine("PercentComplete: 40"); log.Flush(); - Assert.False(_errorKnowledgeBase.IsKnownTestIssue(log, out var failureMessage)); - Assert.Null(failureMessage); + Assert.False(_errorKnowledgeBase.IsKnownTestIssue(log, out var failure)); + Assert.Null(failure); } } @@ -124,8 +124,8 @@ public void DeviceLockedTest() log.WriteLine("05:56:01.8938830 05:56:01.8938670 Pids to kill: 2797"); log.Flush(); - Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failureMessage)); - Assert.Equal(expectedFailureMessage, failureMessage.Value.HumanMessage); + Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failure)); + Assert.Equal(expectedFailureMessage, failure.HumanMessage); } } @@ -167,8 +167,8 @@ public void DeviceUpdateNotFinishedTest() log.WriteLine("[08:44:11.3918090] at Xamarin.Launcher.Driver.Main (System.String[] args) [0x0006d] in /Users/builder/azdo/_work/1/s/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:151 "); log.Flush(); - Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failureMessage)); - Assert.Equal(expectedFailureMessage, failureMessage.Value.HumanMessage); + Assert.True(_errorKnowledgeBase.IsKnownTestIssue(log, out var failure)); + Assert.Equal(expectedFailureMessage, failure.HumanMessage); } } }