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
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,12 @@
<data name="TestsSucceeded" xml:space="preserve">
<value>Tests succeeded: '{0}' [{1}|{2}]</value>
</data>
<data name="IncompatibleArchitecture" xml:space="preserve">
<value>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Výpočet úplné cesty nástroje se nezdařil. Spouštěč {0}</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">Neplatná hodnota TargetPath, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Fehler bei der Berechnung des vollständigen Pfadtools Runner „{0}“</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">Ungültiger TargetPath, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">El cálculo de la herramienta de ruta de acceso completa es incorrecto. Runner '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath no válido, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Désolé... Nous n’avons pas pu effectuer le calcul d’outil de chemin complet. Exécuteur « {0} »</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath non valide, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Calcolo del percorso completo dello strumento non riuscito. Strumento di esecuzione '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath non valido, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">完全なパス ツールの計算に失敗しました。ランナー '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">無効な TargetPath、{0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">전체 경로 도구를 계산하지 못했습니다. 러너 '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">잘못된 TargetPath, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Obliczanie narzędzia pełnej ścieżki nie powiodło się. Moduł uruchamiający „{0}”</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">Nieprawidłowa ścieżka docelowa, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Falha no cálculo da ferramenta de caminho completo. Executor “{0}”</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath inválido, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Сбой вычисления средства полного пути. Средство выполнения тестов "{0}"</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">Недопустимый TargetPath, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">Tam yol aracı hesaplaması başarısız. Çalıştırıcı '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">Geçersiz TargetPath, {0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">完整路径工具计算失败。运行器“{0}”</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath {0} 无效</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<target state="translated">完整路徑工具計算失敗。執行器 '{0}'</target>
<note />
</trans-unit>
<trans-unit id="IncompatibleArchitecture">
<source>Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</source>
<target state="new">Could not find '{0}' host for the '{1}' architecture.

You can resolve the problem by installing the '{1}' .NET.

The specified framework can be found at:
- https://aka.ms/dotnet-download</target>
<note />
</trans-unit>
<trans-unit id="InvalidTargetPath">
<source>Invalid TargetPath, {0}</source>
<target state="translated">TargetPath 無效,{0}</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected override string ToolName
else
{
Log.LogMessage(MessageImportance.Low, resolutionLog.ToString());
Log.LogError(Resources.MSBuildResources.FullPathToolCalculationFailed, dotnetRunnerName);
Log.LogError(string.Format(CultureInfo.InvariantCulture, Resources.MSBuildResources.IncompatibleArchitecture, dotnetRunnerName, TestArchitecture.ItemSpec));
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;

using Microsoft.Testing.Platform.Acceptance.IntegrationTests.Helpers;

namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests;

[TestGroup]
Expand Down Expand Up @@ -159,6 +161,43 @@ await DotnetCli.RunAsync(
Assert.IsTrue(Regex.IsMatch(logFileContent, @"\.dotnet\\x86\\dotnet\.exe"), logFileContent);
}

public async Task Invoke_DotnetTest_With_Incompatible_Arch()
{
Architecture currentArchitecture = RuntimeInformation.ProcessArchitecture;
string incompatibleArchitecture = currentArchitecture switch
{
Architecture.X86 or Architecture.X64 => "arm64",
_ => "x64",
};

TestAsset testAsset = await TestAsset.GenerateAssetAsync(
AssetName,
SourceCode
.PatchCodeWithReplace("$PlatformTarget$", string.Empty)
.PatchCodeWithReplace("$TargetFrameworks$", $"<TargetFramework>{TargetFrameworks.NetCurrent.Arguments}</TargetFramework>")
.PatchCodeWithReplace("$AssertValue$", bool.TrueString.ToLowerInvariant())
.PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)
.PatchCodeWithReplace("$MicrosoftTestingEnterpriseExtensionsVersion$", MicrosoftTestingEnterpriseExtensionsVersion));
DotnetMuxerResult result = await DotnetCli.RunAsync(
$"test --arch {incompatibleArchitecture} -p:TestingPlatformDotnetTestSupport=True \"{testAsset.TargetAssetPath}\"",
_acceptanceFixture.NuGetGlobalPackagesFolder.Path,
failIfReturnValueIsNotZero: false);
// The output looks like:
/*
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : Could not find 'dotnet.exe' host for the 'arm64' architecture. [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : You can resolve the problem by installing the 'arm64' .NET. [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : The specified framework can be found at: [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\tidOn\.packages\microsoft.testing.platform.msbuild\1.5.0-ci\buildMultiTargeting\Microsoft.Testing.Platform.MSBuild.targets(320,5): error : - https://aka.ms/dotnet-download [D:\a\_work\1\s\artifacts\tmp\Debug\testsuite\vf8vR\MSBuildTests\MSBuild Tests.csproj]
Comment thread
Youssef1313 marked this conversation as resolved.
Resolved
*/
// Assert each error line separately for simplicity.
result.AssertOutputContains($"Could not find '{(OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet")}' host for the '{incompatibleArchitecture}' architecture.");
result.AssertOutputContains($"You can resolve the problem by installing the '{incompatibleArchitecture}' .NET.");
result.AssertOutputContains("The specified framework can be found at:");
result.AssertOutputContains(" - https://aka.ms/dotnet-download");
}

public async Task Invoke_DotnetTest_With_DOTNET_HOST_PATH_Should_Work()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Expand Down