From 6a42223d30614e2e88aeba18c93a16aa3b82b166 Mon Sep 17 00:00:00 2001 From: Codrin Poienaru Date: Thu, 21 Jul 2022 18:10:14 +0200 Subject: [PATCH 1/2] Fixed review comments for PR: https://github.com/microsoft/vstest/pull/3728 --- .../Hosting/DefaultTestHostManager.cs | 4 ++-- src/vstest.console/InProcessVsTestConsoleWrapper.cs | 8 ++++---- src/vstest.console/Resources/Resources.Designer.cs | 9 +++++++++ src/vstest.console/Resources/Resources.resx | 5 ++++- src/vstest.console/Resources/xlf/Resources.cs.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.de.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.es.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.fr.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.it.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.ja.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.ko.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.pl.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.pt-BR.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.ru.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.tr.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf | 5 +++++ src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf | 5 +++++ 18 files changed, 89 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs index e71840b561..a201803923 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs @@ -193,8 +193,8 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo( var processName = _processHelper.GetCurrentProcessFileName(); if (processName is not null) { - if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows) && - !processName.EndsWith(DotnetHostHelper.MONOEXENAME, StringComparison.OrdinalIgnoreCase)) + if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows) + && !processName.EndsWith(DotnetHostHelper.MONOEXENAME, StringComparison.OrdinalIgnoreCase)) { launcherPath = _dotnetHostHelper.GetMonoPath(); argumentsString = testhostProcessPath.AddDoubleQuote() + " " + argumentsString; diff --git a/src/vstest.console/InProcessVsTestConsoleWrapper.cs b/src/vstest.console/InProcessVsTestConsoleWrapper.cs index 61c511fb4b..39562db70e 100644 --- a/src/vstest.console/InProcessVsTestConsoleWrapper.cs +++ b/src/vstest.console/InProcessVsTestConsoleWrapper.cs @@ -77,7 +77,7 @@ internal InProcessVsTestConsoleWrapper( { // Close the sender as it failed to host server. _requestSender.Close(); - throw new TransationLayerException("Error hosting communication channel."); + throw new TransationLayerException(Resources.Resources.ErrorHostingCommunicationChannel); } // Fill the parameters. @@ -119,7 +119,7 @@ internal InProcessVsTestConsoleWrapper( if (TestRequestManager is null) { TPDebug.Assert( - (DesignModeClient?)DesignModeClient.Instance != null, + DesignModeClient.Instance != null, "DesignModeClient.Instance is null"); TestRequestManager = ((DesignModeClient)DesignModeClient.Instance).TestRequestManager; } @@ -476,7 +476,7 @@ public void RunTests( var testRunPayload = new TestRunRequestPayload { - Sources = sourceList.ToList(), + Sources = sourceList, RunSettings = runSettings, TestPlatformOptions = options, TestSessionInfo = testSessionInfo @@ -637,7 +637,7 @@ testSessionInfo is null { Sources = sourceList, RunSettings = runSettings, - DebuggingEnabled = (customLauncher?.IsDebug == true), + DebuggingEnabled = customLauncher?.IsDebug == true, TestPlatformOptions = options, TestSessionInfo = testSessionInfo }; diff --git a/src/vstest.console/Resources/Resources.Designer.cs b/src/vstest.console/Resources/Resources.Designer.cs index 02afb24e9c..41abfa4f25 100644 --- a/src/vstest.console/Resources/Resources.Designer.cs +++ b/src/vstest.console/Resources/Resources.Designer.cs @@ -1843,5 +1843,14 @@ internal static string WarningEmulatedOnArm64 { return ResourceManager.GetString("WarningEmulatedOnArm64", resourceCulture); } } + + /// + /// Looks up a localized string similar to Error hosting the communication channel. For better performance, please consider using the native runner vstest.console.arm64.exe.. + /// + internal static string ErrorHostingCommunicationChannel { + get { + return ResourceManager.GetString("ErrorHostingCommunicationChannel", resourceCulture); + } + } } } diff --git a/src/vstest.console/Resources/Resources.resx b/src/vstest.console/Resources/Resources.resx index c7d6cc801d..c055157808 100644 --- a/src/vstest.console/Resources/Resources.resx +++ b/src/vstest.console/Resources/Resources.resx @@ -819,4 +819,7 @@ Waiting for stop test session timed out after {0} seconds. - \ No newline at end of file + + Error hosting communication channel. + + diff --git a/src/vstest.console/Resources/xlf/Resources.cs.xlf b/src/vstest.console/Resources/xlf/Resources.cs.xlf index fbf06e3fc4..63766cbaf2 100644 --- a/src/vstest.console/Resources/xlf/Resources.cs.xlf +++ b/src/vstest.console/Resources/xlf/Resources.cs.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.de.xlf b/src/vstest.console/Resources/xlf/Resources.de.xlf index a7ceee318a..f7c15f8e73 100644 --- a/src/vstest.console/Resources/xlf/Resources.de.xlf +++ b/src/vstest.console/Resources/xlf/Resources.de.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.es.xlf b/src/vstest.console/Resources/xlf/Resources.es.xlf index a859287628..513dcf32c0 100644 --- a/src/vstest.console/Resources/xlf/Resources.es.xlf +++ b/src/vstest.console/Resources/xlf/Resources.es.xlf @@ -1197,6 +1197,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.fr.xlf b/src/vstest.console/Resources/xlf/Resources.fr.xlf index 142988452f..642ee02f7c 100644 --- a/src/vstest.console/Resources/xlf/Resources.fr.xlf +++ b/src/vstest.console/Resources/xlf/Resources.fr.xlf @@ -1194,6 +1194,11 @@ Comportements actuellement pris en charge : Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.it.xlf b/src/vstest.console/Resources/xlf/Resources.it.xlf index b960a91316..1d20148c32 100644 --- a/src/vstest.console/Resources/xlf/Resources.it.xlf +++ b/src/vstest.console/Resources/xlf/Resources.it.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.ja.xlf b/src/vstest.console/Resources/xlf/Resources.ja.xlf index 8db9d74746..7001efeea4 100644 --- a/src/vstest.console/Resources/xlf/Resources.ja.xlf +++ b/src/vstest.console/Resources/xlf/Resources.ja.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.ko.xlf b/src/vstest.console/Resources/xlf/Resources.ko.xlf index ab392741ce..abb7774a0a 100644 --- a/src/vstest.console/Resources/xlf/Resources.ko.xlf +++ b/src/vstest.console/Resources/xlf/Resources.ko.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.pl.xlf b/src/vstest.console/Resources/xlf/Resources.pl.xlf index 6a174f6191..39c491bfa8 100644 --- a/src/vstest.console/Resources/xlf/Resources.pl.xlf +++ b/src/vstest.console/Resources/xlf/Resources.pl.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.pt-BR.xlf b/src/vstest.console/Resources/xlf/Resources.pt-BR.xlf index 7a57ba36cb..667001187d 100644 --- a/src/vstest.console/Resources/xlf/Resources.pt-BR.xlf +++ b/src/vstest.console/Resources/xlf/Resources.pt-BR.xlf @@ -1194,6 +1194,11 @@ Altere o prefixo de nível de diagnóstico do agente de console, como mostrado a Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.ru.xlf b/src/vstest.console/Resources/xlf/Resources.ru.xlf index c09fd33db9..ba836b6952 100644 --- a/src/vstest.console/Resources/xlf/Resources.ru.xlf +++ b/src/vstest.console/Resources/xlf/Resources.ru.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.tr.xlf b/src/vstest.console/Resources/xlf/Resources.tr.xlf index 368be585b4..fc29e320d4 100644 --- a/src/vstest.console/Resources/xlf/Resources.tr.xlf +++ b/src/vstest.console/Resources/xlf/Resources.tr.xlf @@ -1194,6 +1194,11 @@ Günlükler için izleme düzeyini aşağıda gösterildiği gibi değiştirin Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.xlf b/src/vstest.console/Resources/xlf/Resources.xlf index 7f3363d811..02e3b2e4ac 100644 --- a/src/vstest.console/Resources/xlf/Resources.xlf +++ b/src/vstest.console/Resources/xlf/Resources.xlf @@ -988,6 +988,11 @@ Format : TestRunParameters.Parameter(name="<name>", value="<value>") Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf b/src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf index 57196c862e..d46193b53c 100644 --- a/src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf +++ b/src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file diff --git a/src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf b/src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf index e9e812a527..feff38487a 100644 --- a/src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf +++ b/src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf @@ -1194,6 +1194,11 @@ Waiting for stop test session timed out after {0} seconds. + + Error hosting communication channel. + Error hosting communication channel. + + \ No newline at end of file From edf37f6a2f2803f34f5f30b6ac88c94648613b45 Mon Sep 17 00:00:00 2001 From: Codrin-Victor Poienaru Date: Fri, 22 Jul 2022 09:51:55 +0200 Subject: [PATCH 2/2] Update src/vstest.console/InProcessVsTestConsoleWrapper.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Amaury Levé --- src/vstest.console/InProcessVsTestConsoleWrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vstest.console/InProcessVsTestConsoleWrapper.cs b/src/vstest.console/InProcessVsTestConsoleWrapper.cs index 39562db70e..624aed1ea8 100644 --- a/src/vstest.console/InProcessVsTestConsoleWrapper.cs +++ b/src/vstest.console/InProcessVsTestConsoleWrapper.cs @@ -121,7 +121,7 @@ internal InProcessVsTestConsoleWrapper( TPDebug.Assert( DesignModeClient.Instance != null, "DesignModeClient.Instance is null"); - TestRequestManager = ((DesignModeClient)DesignModeClient.Instance).TestRequestManager; + TestRequestManager = DesignModeClient.Instance.TestRequestManager; } _testPlatformEventSource.TranslationLayerInitializeStop();