Numerous failures while building aspnetcore
tests in VMR
#60095
Labels
area-infrastructure
Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Here are the errors encountered when we tried to enable building tests in VMR:
At first this was failing due to missing test certificates, required by various tests. We are skipping the creation of those certificates due to this false condition:
aspnetcore/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets
Lines 34 to 38 in 7340678
MSBuildRuntimeType
is set toFull
due to: https://github.com/dotnet/dotnet/blob/81f0f65d674c3aebd3c1ce78f2e5d831d32980f8/repo-projects/aspnetcore.proj#L19-L21This requires enabling
GenerateTestDevCert
task for .NET FX. Either by shelling out to use external tooling, or reuse some of the code fromCertificateManager
.With test certificates available, we get the following failures:
C:\git\dotnet\src\aspnetcore\src\ProjectTemplates\TestInfrastructure\PrepareForTest.targets(118,5): error MSB3030: Could not copy the file "DontDareMutateThisSDKdotnet.exe" because it was not found. [C:\git\dotnet\src\aspnetcore\src\ProjectTemplates\test\Templates.Blazor.WebAssembly.Auth.Tests\Templates.Blazor.WebAssembly.Auth.Tests.csproj]
The root cause is in this section that talks about not running tests on source-build:
aspnetcore/Directory.Build.props
Lines 188 to 210 in 731c3b7
One idea for fixing this: dotnet/sdk#44843 (comment)
For repro, add
/p:DotNetBuildTests=true
to your Windows VMR build command, i.e.:build -prepareMachine -c Release /p:TargetOS=windows /p:TargetArchitecture=x64 /bl /p:DotNetBuildTests=true
The text was updated successfully, but these errors were encountered: