Skip to content

Commit 016e237

Browse files
authored
[rel/17.3] Do not match .NET Standard to Dotnet testhost runner (#3958)
1 parent c7ba2ca commit 016e237

19 files changed

+67
-55
lines changed

src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ public virtual bool SetupChannel(IEnumerable<string> sources, string? runSetting
272272

273273
// Throw a test platform exception along with the error messages from the test if the test host exited unexpectedly
274274
// before communication was established.
275-
ThrowOnTestHostExited(_testHostExited.IsSet);
275+
ThrowOnTestHostExited(sources, _testHostExited.IsSet);
276276

277277
// Throw a test platform exception stating the connection to test could not be established even after waiting
278278
// for the configure timeout period.
279-
ThrowExceptionOnConnectionFailure(connTimeout);
279+
ThrowExceptionOnConnectionFailure(sources, connTimeout);
280280
}
281281

282282
// Handling special case for dotnet core projects with older test hosts.
@@ -459,17 +459,17 @@ private void TestHostManagerHostExited(object? sender, HostProviderEventArgs? e)
459459
RequestSender.OnClientProcessExit(_testHostProcessStdError);
460460
}
461461

462-
private void ThrowOnTestHostExited(bool testHostExited)
462+
private void ThrowOnTestHostExited(IEnumerable<string> sources, bool testHostExited)
463463
{
464464
if (testHostExited)
465465
{
466466
// We might consider passing standard output here in case standard error is not
467467
// available because some errors don't end up in the standard error output.
468-
throw new TestPlatformException(string.Format(CrossPlatEngineResources.TestHostExitedWithError, _testHostProcessStdError));
468+
throw new TestPlatformException(string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), _testHostProcessStdError));
469469
}
470470
}
471471

472-
private void ThrowExceptionOnConnectionFailure(int connTimeout)
472+
private void ThrowExceptionOnConnectionFailure(IEnumerable<string> sources, int connTimeout)
473473
{
474474
// Failed to launch testhost process.
475475
var errorMsg = CrossPlatEngineResources.InitializationFailed;
@@ -489,7 +489,7 @@ private void ThrowExceptionOnConnectionFailure(int connTimeout)
489489
if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError))
490490
{
491491
// Testhost failed with error.
492-
errorMsg = string.Format(CrossPlatEngineResources.TestHostExitedWithError, _testHostProcessStdError);
492+
errorMsg = string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), _testHostProcessStdError);
493493
}
494494

495495
throw new TestPlatformException(string.Format(CultureInfo.CurrentUICulture, errorMsg));

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.Designer.cs

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
<value>Logging TestHost Diagnostics in file: {0}</value>
170170
</data>
171171
<data name="TestHostExitedWithError" xml:space="preserve">
172-
<value>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</value>
172+
<value>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</value>
173+
<comment>{0} a source, or very rarely list of sources, {1} the output error.</comment>
173174
</data>
174175
<data name="TestRunFailed_NoDiscovererFound_NoTestsAreAvailableInTheSources" xml:space="preserve">
175176
<value>No test is available in {0}. Make sure that test discoverer &amp; executors are registered and platform &amp; framework version settings are appropriate and try again.</value>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.cs.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Proces testhost se ukončil s chybou: {0}. Další informace najdete v diagnostických protokolech.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Proces testhost se ukončil s chybou: {0}. Další informace najdete v diagnostických protokolech.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.de.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Der TestHost-Prozess wurde mit folgendem Fehler beendet: {0}. Weitere Informationen finden Sie in den Diagnoseprotokollen.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Der TestHost-Prozess wurde mit folgendem Fehler beendet: {0}. Weitere Informationen finden Sie in den Diagnoseprotokollen.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.es.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">El proceso del host de prueba finalizó con el siguiente error: {0}. Consulte los registros de diagnóstico para obtener más información.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">El proceso del host de prueba finalizó con el siguiente error: {0}. Consulte los registros de diagnóstico para obtener más información.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.fr.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Le processus Testhost s'est arrêté. Erreur : {0}. Pour plus d'informations, consultez les journaux de diagnostic.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Le processus Testhost s'est arrêté. Erreur : {0}. Pour plus d'informations, consultez les journaux de diagnostic.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.it.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Il processo testhost è terminato con l'errore {0}. Per altre informazioni, vedere i log di diagnostica.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Il processo testhost è terminato con l'errore {0}. Per altre informazioni, vedere i log di diagnostica.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.ja.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Testhost プロセスがエラーで終了しました: {0}。詳細については、診断ログを確認してください。</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Testhost プロセスがエラーで終了しました: {0}。詳細については、診断ログを確認してください。</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.ko.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Testhost 프로세스가 종료되었습니다(오류: {0}). 자세한 내용은 진단 로그를 확인하세요.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Testhost 프로세스가 종료되었습니다(오류: {0}). 자세한 내용은 진단 로그를 확인하세요.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pl.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Zakończono proces testhost z powodu błędu: {0}. Sprawdź dzienniki diagnostyczne, aby uzyskać więcej informacji.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Zakończono proces testhost z powodu błędu: {0}. Sprawdź dzienniki diagnostyczne, aby uzyskać więcej informacji.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.pt-BR.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">O processo do testhost foi encerrado com o erro: {0}. Verifique os logs de diagnóstico para obter mais informações.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">O processo do testhost foi encerrado com o erro: {0}. Verifique os logs de diagnóstico para obter mais informações.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.ru.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Процесс testhost завершился с ошибкой: {0}. Дополнительные сведения см. в журналах диагностики.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Процесс testhost завершился с ошибкой: {0}. Дополнительные сведения см. в журналах диагностики.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.tr.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Testhost işleminden şu hatayla çıkıldı: {0}. Daha fazla bilgi için lütfen tanılama günlüklerine bakın.</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Testhost işleminden şu hatayla çıkıldı: {0}. Daha fazla bilgi için lütfen tanılama günlüklerine bakın.</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.xlf

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
<note></note>
6565
</trans-unit>
6666
<trans-unit id="TestHostExitedWithError">
67-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
67+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
6868
<target state="new">Testhost process exited with error: {0}</target>
69-
<note></note>
69+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
7070
</trans-unit>
7171
<trans-unit id="DataCollectorDebuggerWarning">
7272
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.zh-Hans.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Testhost 进程已退出,但出现错误: {0}。请查看诊断日志了解详细信息。</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Testhost 进程已退出,但出现错误: {0}。请查看诊断日志了解详细信息。</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.CrossPlatEngine/Resources/xlf/Resources.zh-Hant.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<note></note>
7979
</trans-unit>
8080
<trans-unit id="TestHostExitedWithError">
81-
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
82-
<target state="translated">Testhost 處理序已結束。錯誤: {0}。如需詳細資訊,請查看診斷記錄。</target>
83-
<note></note>
81+
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
82+
<target state="new">Testhost 處理序已結束。錯誤: {0}。如需詳細資訊,請查看診斷記錄。</target>
83+
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
8484
</trans-unit>
8585
<trans-unit id="DataCollectorDebuggerWarning">
8686
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>

src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,7 @@ public bool CanExecuteCurrentRunConfiguration(string? runsettingsXml)
610610
var config = XmlRunSettingsUtilities.GetRunConfigurationNode(runsettingsXml);
611611
var framework = config.TargetFramework;
612612

613-
// This is expected to be called once every run so returning a new instance every time.
614-
return framework!.Name.IndexOf("netstandard", StringComparison.OrdinalIgnoreCase) >= 0
615-
|| framework.Name.IndexOf("netcoreapp", StringComparison.OrdinalIgnoreCase) >= 0
613+
return framework!.Name.IndexOf("netcoreapp", StringComparison.OrdinalIgnoreCase) >= 0
616614
|| framework.Name.IndexOf("net5", StringComparison.OrdinalIgnoreCase) >= 0;
617615
}
618616

0 commit comments

Comments
 (0)