Onboard Central Package Management (#2728)

This commit is contained in:
Amaury Levé 2024-04-18 22:14:28 +02:00 коммит произвёл GitHub
Родитель d9423cc5fa
Коммит 7b92db6824
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
32 изменённых файлов: 208 добавлений и 129 удалений

73
Directory.Packages.props Normal file
Просмотреть файл

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<PropertyGroup Label="Product dependencies">
<!-- Test Platform, .NET Test SDK and Object Model -->
<MicrosoftNETTestSdkVersion>17.9.0</MicrosoftNETTestSdkVersion>
<!-- UWP and WinUI dependencies -->
<MicrosoftNETCoreUniversalWindowsPlatformVersion>6.2.14</MicrosoftNETCoreUniversalWindowsPlatformVersion>
<!-- / UWP and WinUI dependencies -->
<!-- CVE-2017-0247 -->
<SystemNetWebSocketsClientVersion>4.3.1</SystemNetWebSocketsClientVersion>
<SystemTextRegularExpressionsVersion>4.3.1</SystemTextRegularExpressionsVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24072.1</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisVersion>3.11.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>$(MicrosoftCodeAnalysisAnalyzersVersion)</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<MicrosoftPlaywrightVersion>1.42.0</MicrosoftPlaywrightVersion>
</PropertyGroup>
<PropertyGroup Label="Test dependencies">
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.2-beta1.24074.2</MicrosoftCodeAnalysisAnalyzerTestingVersion>
<MicrosoftTestingExtensionsCodeCoverageVersion>17.11.1-preview.24217.3</MicrosoftTestingExtensionsCodeCoverageVersion>
</PropertyGroup>
<ItemGroup Label="Product dependencies">
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(MicrosoftCodeAnalysisBannedApiAnalyzersVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(MicrosoftTestingExtensionsCodeCoverageVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.Retry" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Extensions.VSTestBridge" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Internal.Framework.SourceGeneration" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.AdapterUtilities" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.TranslationLayer" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.TestPlatform" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.28" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<!-- CVE-2019-0820 -->
<PackageVersion Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
<!-- CVE-2019-0981, CVE-2019-0980, CVE-2019-0657 -->
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup Label="Test dependencies">
<PackageVersion Include="FSharp.Core" Version="8.0.101" />
<!-- Pinned to 4.18.4 for security -->
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.2.169" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<!-- CVE-2024-0057 / Transitive deps of code analysis testing packages -->
<PackageVersion Include="NuGet.Packaging" Version="6.3.4" />
<PackageVersion Include="Polly" Version="8.3.0" />
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageVersion Include="StreamJsonRpc" Version="2.17.11" />
<PackageVersion Include="StrongNamer" Version="0.2.5" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.Management" Version="8.0.0" />
</ItemGroup>
</Project>

Просмотреть файл

@ -17,4 +17,21 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
<packageSourceMapping>
<packageSource key="test-tools">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-public">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-tools">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-eng">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>

Просмотреть файл

@ -50,6 +50,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.Local.targets = Directory.Build.Local.targets
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
global.json = global.json
Nuget.config = Nuget.config
EndProjectSection
@ -198,7 +199,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSTest.Performance.Runner",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playground", "samples\Playground\Playground.csproj", "{8A41B37E-0732-4F28-B214-A44233B447FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest.Acceptance.IntegrationTests", "test\IntegrationTests\MSTest.Acceptance.IntegrationTests\MSTest.Acceptance.IntegrationTests.csproj", "{BCB42780-C559-40B6-8C4A-85EBC464AAA8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSTest.Acceptance.IntegrationTests", "test\IntegrationTests\MSTest.Acceptance.IntegrationTests\MSTest.Acceptance.IntegrationTests.csproj", "{BCB42780-C559-40B6-8C4A-85EBC464AAA8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -8,22 +8,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers"
Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)"
PrivateAssets="all"
Condition="'$(IsSourceProject)' == 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers"
Version="$(MicrosoftCodeAnalysisBannedApiAnalyzersVersion)"
PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(IsSourceProject)' == 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="all" />
<AdditionalFiles Include="$(RepositoryEngineeringDir)stylecop.json" Link="stylecop.json" />
<PackageReference Include="StyleCop.Analyzers"
Version="$(StyleCopAnalyzersVersion)"
PrivateAsset="all" />
<PackageReference Include="StyleCop.Analyzers" PrivateAsset="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers"
Version="$(MicrosoftVisualStudioThreadingAnalyzersVersion)"
PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all" />
</ItemGroup>
</Project>

Просмотреть файл

@ -4,46 +4,10 @@
<VersionPrefix>3.4.0</VersionPrefix>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
</PropertyGroup>
<PropertyGroup Label="MSTest dependencies">
<!-- Test Platform, .NET Test SDK and Object Model -->
<MicrosoftNETTestSdkVersion>17.9.0</MicrosoftNETTestSdkVersion>
<!-- UWP and WinUI dependencies -->
<MicrosoftNETCoreUniversalWindowsPlatformVersion>6.2.14</MicrosoftNETCoreUniversalWindowsPlatformVersion>
<MicrosoftWindowsAppSDKVersion>1.0.0</MicrosoftWindowsAppSDKVersion>
<!-- / UWP and WinUI dependencies -->
<!-- CVE-2017-0247 -->
<SystemNetWebSocketsClientVersion>4.3.1</SystemNetWebSocketsClientVersion>
<!-- CVE-2019-0981, CVE-2019-0980, CVE-2019-0657 -->
<SystemPrivateUriVersion>4.3.2</SystemPrivateUriVersion>
<!-- CVE-2019-0820 -->
<SystemDiagnosticsTextWriterTraceListenerVersion>4.3.0</SystemDiagnosticsTextWriterTraceListenerVersion>
<SystemTextRegularExpressionsVersion>4.3.1</SystemTextRegularExpressionsVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24072.1</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisVersion>3.11.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>$(MicrosoftCodeAnalysisAnalyzersVersion)</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<!-- MSBuild Sdk versions updates -->
<PropertyGroup Label="MSTest darc updated dependencies">
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>8.0.0-beta.24204.3</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
<MicrosoftPlaywrightVersion>1.42.0</MicrosoftPlaywrightVersion>
<MicrosoftTestingFrameworkVersion>1.2.0-preview.24168.3</MicrosoftTestingFrameworkVersion>
<MicrosoftTestingPlatformVersion>1.2.0-preview.24217.2</MicrosoftTestingPlatformVersion>
<MicrosoftVisualStudioThreadingAnalyzersVersion>17.9.28</MicrosoftVisualStudioThreadingAnalyzersVersion>
<MSTestEngineVersion>1.0.0-alpha.24217.2</MSTestEngineVersion>
<StyleCopAnalyzersVersion>1.2.0-beta.556</StyleCopAnalyzersVersion>
</PropertyGroup>
<PropertyGroup Label="MSTest test dependencies">
<FluentAssertionsVersion>6.12.0</FluentAssertionsVersion>
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.2-beta1.24074.2</MicrosoftCodeAnalysisAnalyzerTestingVersion>
<MicrosoftTestingExtensionsCodeCoverageVersion>17.11.1-preview.24217.4</MicrosoftTestingExtensionsCodeCoverageVersion>
<!-- Pinned to 4.18.4 for security -->
<MoqVersion>4.18.4</MoqVersion>
<MSBuildStructuredLogger>2.2.169</MSBuildStructuredLogger>
<!-- CVE-2024-0057 / Transitive deps of code analysis testing packages -->
<NuGetPackagingVersion>6.3.4</NuGetPackagingVersion>
<PollyVersion>8.3.0</PollyVersion>
<PollyContribWaitAndRetryVersion>1.1.1</PollyContribWaitAndRetryVersion>
<StrongNamerVersion>0.2.5</StrongNamerVersion>
<StreamJsonRpcVersion>2.17.11</StreamJsonRpcVersion>
</PropertyGroup>
</Project>

Просмотреть файл

@ -12,8 +12,11 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj" />
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTest.TestAdapter\MSTest.TestAdapter.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0-preview-24080-01" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
</ItemGroup>
<ItemGroup>
@ -21,5 +24,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

Просмотреть файл

@ -47,9 +47,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.AdapterUtilities" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.VSTestBridge" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.TestPlatform.AdapterUtilities" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Include="Microsoft.Testing.Extensions.VSTestBridge" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -35,13 +35,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Condition=" '$(TargetFramework)' == '$(WinUiMinimum)' " Version="$(SystemDiagnosticsTextWriterTraceListenerVersion)" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Condition=" '$(TargetFramework)' == '$(WinUiMinimum)' " />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == '$(UwpMinimum)' OR '$(TargetFramework)' == '$(WinUiMinimum)' ">
<!-- CVE-2019-0981, CVE-2019-0980, CVE-2019-0657 -->
<PackageReference Include="System.Private.Uri" Version="$(SystemPrivateUriVersion)" />
<PackageReference Include="System.Private.Uri" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -20,8 +20,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -15,12 +15,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(MicrosoftTestingExtensionsCodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" />
<PackageReference Include="StreamJsonRpc" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -58,9 +58,10 @@ public class UnitTest1
static AcceptanceTestBase()
{
XDocument versionsPropFileDoc = XDocument.Load(Path.Combine(RootFinder.Find(), "eng", "Versions.props"));
MicrosoftNETTestSdkVersion = versionsPropFileDoc.Descendants("MicrosoftNETTestSdkVersion").Single().Value;
XDocument cpmPropFileDoc = XDocument.Load(Path.Combine(RootFinder.Find(), "Directory.Packages.props"));
MicrosoftNETTestSdkVersion = cpmPropFileDoc.Descendants("MicrosoftNETTestSdkVersion").Single().Value;
XDocument versionsPropFileDoc = XDocument.Load(Path.Combine(RootFinder.Find(), "eng", "Versions.props"));
#if MSTEST_DOWNLOADED
MSTestVersion = ExtractVersionFromVersionPropsFile(versionsPropFileDoc, "MSTestVersion");
MicrosoftTestingPlatformVersion = ExtractVersionFromPackage(Constants.ArtifactsPackagesShipping, MicrosoftTestingPlatformNamePrefix);

Просмотреть файл

@ -10,13 +10,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MSBuild.StructuredLogger" Version="$(MSBuildStructuredLogger)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(MicrosoftTestingExtensionsCodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.Retry" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" Version="$(MicrosoftTestingPlatformVersion)" GeneratePathProperty="True" />
<PackageReference Include="MSBuild.StructuredLogger" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="Microsoft.Testing.Extensions.Retry" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" GeneratePathProperty="True" />
</ItemGroup>
<!-- Packages needed for the test assets but that we don't want to reference -->

Просмотреть файл

@ -11,9 +11,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="StrongNamer" Version="$(StrongNamerVersion)" />
<PackageReference Include="Moq" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="StrongNamer" />
</ItemGroup>
</Project>

Просмотреть файл

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -20,7 +20,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -7,7 +7,11 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTest.TestAdapter\MSTest.TestAdapter.csproj" />
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTest.TestAdapter\MSTest.TestAdapter.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -8,9 +8,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="System.Management" />
<PackageReference Include="System.CommandLine" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)test\Utilities\Microsoft.Testing.TestInfrastructure\Microsoft.Testing.TestInfrastructure.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -11,17 +11,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(MicrosoftTestingExtensionsCodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" />
<!-- CVE-2024-0057 / Transitive deps of code analysis testing packages -->
<PackageReference Include="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
<PackageReference Include="NuGet.Packaging" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -33,8 +33,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Moq" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net462' ">

Просмотреть файл

@ -25,7 +25,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="Moq" />
</ItemGroup>
</Project>

Просмотреть файл

@ -22,12 +22,12 @@
<!-- end netstandard2.0 polyfill -->
<ItemGroup>
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="$(MicrosoftTestingExtensionsCodeCoverageVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" />
<PackageReference Include="Microsoft.Testing.Internal.Framework.SourceGeneration" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -19,7 +19,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="Moq" />
</ItemGroup>
</Project>

Просмотреть файл

@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.TestPlatform.TranslationLayer" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="Microsoft.TestPlatform" />
<PackageReference Include="Microsoft.TestPlatform.TranslationLayer" />
<PackageReference Include="FluentAssertions" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -11,8 +11,6 @@ namespace Microsoft.MSTestV2.CLIAutomation;
public partial class CLITestBase : TestContainer
{
private const string EngineeringFolder = "eng";
private const string Configuration =
#if DEBUG
"Debug";
@ -25,10 +23,10 @@ public partial class CLITestBase : TestContainer
#pragma warning restore IDE0051 // Remove unused private members
private const string DefaultTargetFramework = "net462";
protected static XmlDocument ReadVersionProps()
protected static XmlDocument ReadCPMFile()
{
var versionPropsFilePath = Path.Combine(GetArtifactsBinFolderPath(), "..", "..", EngineeringFolder, "Versions.props");
using var fileStream = File.OpenRead(versionPropsFilePath);
var cpmFilePath = Path.Combine(GetArtifactsBinFolderPath(), "..", "..", "Directory.Packages.props");
using var fileStream = File.OpenRead(cpmFilePath);
#pragma warning disable CA3075 // Insecure DTD processing in XML
using var xmlTextReader = new XmlTextReader(fileStream) { Namespaces = false };
#pragma warning restore CA3075 // Insecure DTD processing in XML
@ -40,8 +38,8 @@ public partial class CLITestBase : TestContainer
protected static string GetTestPlatformVersion()
{
var versionPropsXml = ReadVersionProps();
var testSdkVersion = versionPropsXml.DocumentElement.SelectSingleNode($"PropertyGroup/MicrosoftNETTestSdkVersion");
var cpmXml = ReadCPMFile();
var testSdkVersion = cpmXml.DocumentElement.SelectSingleNode($"PropertyGroup/MicrosoftNETTestSdkVersion");
return testSdkVersion.InnerText;
}

Просмотреть файл

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Testing.Internal.Framework" Version="$(MicrosoftTestingPlatformVersion)" />
<PackageReference Include="Polly" Version="$(PollyVersion)" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="$(PollyContribWaitAndRetryVersion)" />
<PackageReference Include="Microsoft.Testing.Internal.Framework" />
<PackageReference Include="Polly" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" />
</ItemGroup>
</Project>

Просмотреть файл

@ -165,9 +165,8 @@ public class TempDirectory : IDisposable
string directoryPath = System.IO.Path.Combine(currentDirectory, "tmp", Constants.BuildConfiguration, "testsuite", RandomId.Next());
Directory.CreateDirectory(directoryPath);
string directoryProp = System.IO.Path.Combine(directoryPath, "Directory.Build.props");
string directoryTarget = System.IO.Path.Combine(directoryPath, "Directory.Build.targets");
File.WriteAllText(directoryProp, $"""
string directoryBuildProps = System.IO.Path.Combine(directoryPath, "Directory.Build.props");
File.WriteAllText(directoryBuildProps, $"""
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
@ -180,9 +179,21 @@ public class TempDirectory : IDisposable
</PropertyGroup>
</Project>
""");
File.WriteAllText(directoryTarget, """
string directoryBuildTarget = System.IO.Path.Combine(directoryPath, "Directory.Build.targets");
File.WriteAllText(directoryBuildTarget, """
<?xml version="1.0" encoding="utf-8"?>
<Project/>
""");
string directoryPackagesProps = System.IO.Path.Combine(directoryPath, "Directory.Packages.props");
File.WriteAllText(directoryPackagesProps, """
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
""");
string finalDirectory = directoryPath;

Просмотреть файл

@ -94,6 +94,20 @@ public class TestAsset : IDisposable
<config>
<add key="globalPackagesFolder" value=".packages" />
</config>
<packageSourceMapping>
<packageSource key="local-nonshipping">
<package pattern="*" />
</packageSource>
<packageSource key="local-shipping">
<package pattern="*" />
</packageSource>
<packageSource key="local-tmp-packages">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-public">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
""";

Просмотреть файл

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
</ItemGroup>
</Project>