From 0e0d951cdbfc9c2b43d3a926d43a59366380a42f Mon Sep 17 00:00:00 2001 From: Premek Vysoky Date: Mon, 18 May 2020 15:19:47 +0200 Subject: [PATCH 1/2] Stop passing mlaunch output to stderr of XHarness CLI --- .../AppRunner.cs | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/src/Microsoft.DotNet.XHarness.iOS/AppRunner.cs b/src/Microsoft.DotNet.XHarness.iOS/AppRunner.cs index 982965054..e55535f62 100644 --- a/src/Microsoft.DotNet.XHarness.iOS/AppRunner.cs +++ b/src/Microsoft.DotNet.XHarness.iOS/AppRunner.cs @@ -231,24 +231,6 @@ public AppRunner(IMLaunchProcessManager processManager, deviceName = simulator.Name; - string? stdoutLogPath = null, stderrLogPath = null; - - if (!target.IsWatchOSTarget()) - { - var stderrTty = _helpers.GetTerminalName(2); - if (!string.IsNullOrEmpty(stderrTty)) - { - args.Add(new SetStderrArgument(stderrTty)); - } - else - { - stdoutLogPath = _logs.CreateFile($"mlaunch-stdout-{_helpers.Timestamp}.log", "Standard output"); - stderrLogPath = _logs.CreateFile($"mlaunch-stderr-{_helpers.Timestamp}.log", "Standard error"); - args.Add(new SetStdoutArgument(stdoutLogPath)); - args.Add(new SetStderrArgument(stderrLogPath)); - } - } - var systemLogs = new List(); foreach (var sim in simulators) { @@ -308,25 +290,6 @@ public AppRunner(IMLaunchProcessManager processManager, log.StopCapture(); log.Dispose(); } - - // Remove empty files - if (stdoutLogPath != null) - { - var fileInfo = new FileInfo(stdoutLogPath); - if (fileInfo.Exists && fileInfo.Length == 0) - { - fileInfo.Delete(); - } - } - - if (stderrLogPath != null) - { - var fileInfo = new FileInfo(stderrLogPath); - if (fileInfo.Exists && fileInfo.Length == 0) - { - fileInfo.Delete(); - } - } } } else From 04228dca2cecd9457e3b341948529fc1665d0874 Mon Sep 17 00:00:00 2001 From: Premek Vysoky Date: Mon, 18 May 2020 15:24:57 +0200 Subject: [PATCH 2/2] Fix unit tests --- tests/Microsoft.DotNet.XHarness.iOS.Tests/AppRunnerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Microsoft.DotNet.XHarness.iOS.Tests/AppRunnerTests.cs b/tests/Microsoft.DotNet.XHarness.iOS.Tests/AppRunnerTests.cs index a57cc34cf..24e445c55 100644 --- a/tests/Microsoft.DotNet.XHarness.iOS.Tests/AppRunnerTests.cs +++ b/tests/Microsoft.DotNet.XHarness.iOS.Tests/AppRunnerTests.cs @@ -286,7 +286,7 @@ public async Task RunOnSimulatorSuccessfullyTest(bool useTunnel, bool useXml) $"-argument=-app-arg:-hostname:127.0.0.1 -setenv=NUNIT_HOSTNAME=127.0.0.1 -argument=-app-arg:-transport:Tcp " + $"-setenv=NUNIT_TRANSPORT=TCP -argument=-app-arg:-hostport:{_listener.Object.Port} " + $"-setenv=NUNIT_HOSTPORT={_listener.Object.Port} {xmlParam}--launchsim {StringUtils.FormatArguments(s_appPath)} " + - $"--stderr=tty1 --device=:v2:udid={simulator.Object.UDID}"; + $"--device=:v2:udid={simulator.Object.UDID}"; _processManager .Verify(