Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Microsoft.DotNet.XHarness.Android/AdbRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public bool TryDumpAdbLog(string outputFilePath, string filterSpec = "")
Directory.CreateDirectory(Path.GetDirectoryName(outputFilePath) ?? throw new ArgumentNullException(nameof(outputFilePath)));
File.WriteAllText(outputFilePath, result.StandardOutput);
_log.LogInformation($"Wrote current ADB log to {outputFilePath}");
// The adb log is not directly accessible.
// Hence, we duplicate the log to the main console log to simplify the UX of failure investigation.
_log.LogInformation($"ADB log output:{Environment.NewLine}{result.StandardOutput}");
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ private CancellationTokenSource CaptureLogStream(string appName, bool useSimctl,
}
else
{
// For MacCatalyst, the test output log does not propagate to the main log.
// Hence, we duplicate the log to the main console log to simplify the UX of failure investigation.
IFileBackedLog aggregatedAppOutputLog = Log.CreateReadableAggregatedLog(_mainLog, log);
_processManager
.ExecuteCommandAsync("log", logArgs, _mainLog, log, log, TimeSpan.FromDays(1), cancellationToken: streamCancellation)
.ExecuteCommandAsync("log", logArgs, _mainLog, aggregatedAppOutputLog, aggregatedAppOutputLog, TimeSpan.FromDays(1), cancellationToken: streamCancellation)
.DoNotAwait();
}

Expand Down
11 changes: 8 additions & 3 deletions src/Microsoft.DotNet.XHarness.Apple/AppOperations/AppTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public AppTester(
using var crashLogs = new Logs(_logs.Directory);

ICrashSnapshotReporter crashReporter = _snapshotReporterFactory.Create(_mainLog, crashLogs, isDevice: !isSimulator, device.Name);
using ITestReporter testReporter = _testReporterFactory.Create(_mainLog,
using ITestReporter testReporter = _testReporterFactory.Create(
_mainLog,
_mainLog,
_logs,
crashReporter,
Expand Down Expand Up @@ -361,11 +362,15 @@ private async Task RunDeviceTests(
// We need to check for MT1111 (which means that mlaunch won't wait for the app to exit)
IFileBackedLog aggregatedLog = Log.CreateReadableAggregatedLog(_mainLog, testReporter.CallbackLog);

// The app output log is not directly accessible.
// Hence, we duplicate the log to the main console log to simplify the UX of failure investigation.
IFileBackedLog aggregatedAppOutputLog = Log.CreateReadableAggregatedLog(_mainLog, appOutputLog);

var result = await RunAndWatchForAppSignal(() => _processManager.ExecuteCommandAsync(
mlaunchArguments,
aggregatedLog,
appOutputLog,
appOutputLog,
aggregatedAppOutputLog,
aggregatedAppOutputLog,
timeout,
envVars,
cancellationToken: cancellationToken));
Expand Down
Loading