Skip to content

Commit

Permalink
[rel/17.3] Do not match .NET Standard to Dotnet testhost runner (#3958)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored Aug 24, 2022
1 parent c7ba2ca commit 016e237
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ public virtual bool SetupChannel(IEnumerable<string> sources, string? runSetting

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

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

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

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

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

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
<value>Logging TestHost Diagnostics in file: {0}</value>
</data>
<data name="TestHostExitedWithError" xml:space="preserve">
<value>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</value>
<value>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</value>
<comment>{0} a source, or very rarely list of sources, {1} the output error.</comment>
</data>
<data name="TestRunFailed_NoDiscovererFound_NoTestsAreAvailableInTheSources" xml:space="preserve">
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Proces testhost se ukončil s chybou: {0}. Další informace najdete v diagnostických protokolech.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Proces testhost se ukončil s chybou: {0}. Další informace najdete v diagnostických protokolech.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Der TestHost-Prozess wurde mit folgendem Fehler beendet: {0}. Weitere Informationen finden Sie in den Diagnoseprotokollen.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Der TestHost-Prozess wurde mit folgendem Fehler beendet: {0}. Weitere Informationen finden Sie in den Diagnoseprotokollen.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<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>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<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>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Le processus Testhost s'est arrêté. Erreur : {0}. Pour plus d'informations, consultez les journaux de diagnostic.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Le processus Testhost s'est arrêté. Erreur : {0}. Pour plus d'informations, consultez les journaux de diagnostic.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Il processo testhost è terminato con l'errore {0}. Per altre informazioni, vedere i log di diagnostica.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Il processo testhost è terminato con l'errore {0}. Per altre informazioni, vedere i log di diagnostica.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Testhost プロセスがエラーで終了しました: {0}。詳細については、診断ログを確認してください。</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost プロセスがエラーで終了しました: {0}。詳細については、診断ログを確認してください。</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Testhost 프로세스가 종료되었습니다(오류: {0}). 자세한 내용은 진단 로그를 확인하세요.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 프로세스가 종료되었습니다(오류: {0}). 자세한 내용은 진단 로그를 확인하세요.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Zakończono proces testhost z powodu błędu: {0}. Sprawdź dzienniki diagnostyczne, aby uzyskać więcej informacji.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Zakończono proces testhost z powodu błędu: {0}. Sprawdź dzienniki diagnostyczne, aby uzyskać więcej informacji.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<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>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<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>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Процесс testhost завершился с ошибкой: {0}. Дополнительные сведения см. в журналах диагностики.</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Процесс testhost завершился с ошибкой: {0}. Дополнительные сведения см. в журналах диагностики.</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<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>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<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>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost process exited with error: {0}</target>
<note></note>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Testhost 进程已退出,但出现错误: {0}。请查看诊断日志了解详细信息。</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 进程已退出,但出现错误: {0}。请查看诊断日志了解详细信息。</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<note></note>
</trans-unit>
<trans-unit id="TestHostExitedWithError">
<source>Testhost process exited with error: {0}. Please check the diagnostic logs for more information.</source>
<target state="translated">Testhost 處理序已結束。錯誤: {0}。如需詳細資訊,請查看診斷記錄。</target>
<note></note>
<source>Testhost process for source(s) '{0}' exited with error: {1}. Please check the diagnostic logs for more information.</source>
<target state="new">Testhost 處理序已結束。錯誤: {0}。如需詳細資訊,請查看診斷記錄。</target>
<note>{0} a source, or very rarely list of sources, {1} the output error.</note>
</trans-unit>
<trans-unit id="DataCollectorDebuggerWarning">
<source>DataCollector debugging is enabled. Please attach debugger to datacollector process to continue.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,7 @@ public bool CanExecuteCurrentRunConfiguration(string? runsettingsXml)
var config = XmlRunSettingsUtilities.GetRunConfigurationNode(runsettingsXml);
var framework = config.TargetFramework;

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

Expand Down
Loading

0 comments on commit 016e237

Please sign in to comment.