[net8.0] Fix the Windows tests (#17939)
1. Keep the .NET 6 feed, because even though we've dropped support for
.NET 6, parts of the build may still need access to the feed.
> Workload installation failed: microsoft.maccatalyst.sdk::16.2.19 is
not found in NuGet feeds [long list of feeds, but not the right one]
2. Pass a runsettings to 'dotnet test' to tell it to use the .NET
version we've downloaded, otherwise it will try to use any .NET version
installed on the system (🤦♂️) - which doesn't work because we need to
use .NET 8, and the system only has .NET 7.
This commit is contained in:
Родитель
6d6cee815e
Коммит
5252b92c82
|
@ -20,6 +20,8 @@
|
|||
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
|
||||
<add key="Dotnet arcade" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
|
||||
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
|
||||
<!-- We've dropped support for .NET 6, but let's keep the feed in for a little while longer to make sure it's dropped throughout our entire stack and the lack of this feed doesn't break our build. -->
|
||||
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
|
||||
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
|
||||
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
|
||||
<!-- dotnet8-transport is required for Microsoft.DotNet.Cecil -->
|
||||
|
|
|
@ -124,6 +124,19 @@ steps:
|
|||
displayName: 'Build dependencies for .NET tests'
|
||||
continueOnError: true
|
||||
|
||||
- pwsh: |
|
||||
$runsettings = @"
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RunSettings>
|
||||
<RunConfiguration>
|
||||
<DotNetHostPath>$(Build.SourcesDirectory)\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe</DotNetHostPath>
|
||||
</RunConfiguration>
|
||||
</RunSettings>
|
||||
"@
|
||||
Set-Content -Path $(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/Windows/config.runsettings -Value $runsettings
|
||||
Get-Content -Path $(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/Windows/config.runsettings | Write-Host
|
||||
displayName: 'Create runsettings for .NET tests'
|
||||
|
||||
- pwsh: |
|
||||
$Env:DOTNET = "$(Build.SourcesDirectory)\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe"
|
||||
& $(Build.SourcesDirectory)\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe `
|
||||
|
@ -131,6 +144,7 @@ steps:
|
|||
"$(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/UnitTests/DotNetUnitTests.csproj" `
|
||||
--filter Category=Windows `
|
||||
--verbosity quiet `
|
||||
--settings $(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/Windows/config.runsettings `
|
||||
"-bl:$(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/Windows/run-dotnet-tests.binlog"
|
||||
displayName: 'Run .NET tests'
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче