Skip to content

Commit

Permalink
Enable tests in VMR (#77179)
Browse files Browse the repository at this point in the history
Fixes #76960

Roslyn tests are failing in VMR with mismatched package version errors,
i.e.:
```
C:\git\dotnet\src\roslyn\src\Compilers\Core\CodeAnalysisTest\Microsoft.CodeAnalysis.UnitTests.csproj : error NU1109: Detected package downgrade: Microsoft.TestPlatform.ObjectModel from 17.12.0 to centrally defined 17.5.0. Update the centrally managed package version to a higher version.  [C:\git\dotnet\src\roslyn\Roslyn.sln]
C:\git\dotnet\src\roslyn\src\Compilers\Core\CodeAnalysisTest\Microsoft.CodeAnalysis.UnitTests.csproj : error NU1109:  Microsoft.CodeAnalysis.UnitTests -> Microsoft.NET.Test.Sdk 17.12.0 -> Microsoft.TestPlatform.TestHost 17.12.0 -> Microsoft.TestPlatform.ObjectModel (>= 17.12.0)  [C:\git\dotnet\src\roslyn\Roslyn.sln]
C:\git\dotnet\src\roslyn\src\Compilers\Core\CodeAnalysisTest\Microsoft.CodeAnalysis.UnitTests.csproj : error NU1109:  Microsoft.CodeAnalysis.UnitTests -> Microsoft.TestPlatform.ObjectModel (>= 17.5.0) [C:\git\dotnet\src\roslyn\Roslyn.sln]
```

The fix is to explicitly set the version of `Microsoft.NET.Test.Sdk`
that is consumed by arcade version that Roslyn uses.
  • Loading branch information
NikolaMilosavljevic authored Feb 12, 2025
2 parents 86632f1 + f252374 commit c988759
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ILAsmPackageVersion>9.0.0-rc.2.24462.10</ILAsmPackageVersion>
<ILDAsmPackageVersion>6.0.0-rtm.21518.12</ILDAsmPackageVersion>
<MicrosoftILVerificationVersion>7.0.0-alpha.1.22060.1</MicrosoftILVerificationVersion>
<_MicrosoftTestPlatformVersion>17.5.0</_MicrosoftTestPlatformVersion>
<!--
VS .NET Runtime
Expand Down Expand Up @@ -142,8 +141,8 @@
-->
<PackageVersion Include="Microsoft.VisualStudio.LanguageServer.Client.Implementation" Version="17.10.72-preview" />
<PackageVersion Include="NuGet.ProjectModel" Version="6.8.0-rc.112" />
<PackageVersion Include="Microsoft.TestPlatform.TranslationLayer" Version="$(_MicrosoftTestPlatformVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="$(_MicrosoftTestPlatformVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.TranslationLayer" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace" Version="9.0.0-preview.25064.4" />

<!--
Expand Down
8 changes: 8 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,12 @@
<!-- Prohibit the usage of .NET Standard 1.x dependencies. -->
<FlagNetStandard1XDependencies Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</FlagNetStandard1XDependencies>
</PropertyGroup>
<PropertyGroup>
<!--
Test SDK should match the version of TestPlatform packages required by this repo and defined
in Directory.Packages.props - Microsoft.TestPlatform.TranslationLayer and Microsoft.TestPlatform.ObjectModel.
This version needs to match the Test SDK version consumed by Arcade.
-->
<MicrosoftNETTestSdkVersion>17.5.0</MicrosoftNETTestSdkVersion>
</PropertyGroup>
</Project>

0 comments on commit c988759

Please sign in to comment.