Skip to content

Commit ba81355

Browse files
authored
Merge pull request #1527 from microsoft/dev/andarno/xunitv3
Migrate to xunit.v3 and MTP 2
2 parents 5f03daf + 12f888b commit ba81355

File tree

67 files changed

+247
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+247
-331
lines changed

Directory.Packages.props

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<PropertyGroup>
55
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
66
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
7+
<MicrosoftTestingPlatformVersion>2.0.2</MicrosoftTestingPlatformVersion>
78
<MicroBuildVersion>2.0.208</MicroBuildVersion>
89
<CodeAnalysisVersion>3.11.0</CodeAnalysisVersion>
9-
<CodeAnalysisVersionForTests>4.13.0</CodeAnalysisVersionForTests>
1010
<CodefixTestingVersion>1.1.2</CodefixTestingVersion>
1111
<CodeAnalysisAnalyzerVersion>3.11.0-beta1.25076.3</CodeAnalysisAnalyzerVersion>
1212
</PropertyGroup>
@@ -36,22 +36,17 @@
3636
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
3737
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
3838
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
39-
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
40-
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
41-
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.23" />
42-
<PackageVersion Include="Xunit.StaFact" Version="1.2.69" />
43-
</ItemGroup>
44-
<ItemGroup Condition="'$(IsTestProject)'=='true'">
45-
<PackageVersion Update="Microsoft.CodeAnalysis" Version="$(CodeAnalysisVersionForTests)" />
46-
<PackageVersion Update="Microsoft.CodeAnalysis.Common" Version="$(CodeAnalysisVersionForTests)" />
47-
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="$(CodeAnalysisVersionForTests)" />
48-
<PackageVersion Update="Microsoft.CodeAnalysis.VisualBasic" Version="$(CodeAnalysisVersionForTests)" />
39+
<PackageVersion Include="xunit.v3.core.mtp-v2" Version="3.2.1" />
40+
<PackageVersion Include="Xunit.Combinatorial" Version="2.0.24" />
41+
<PackageVersion Include="Xunit.StaFact" Version="3.0.13" />
4942
</ItemGroup>
5043
<ItemGroup Label="Library.Template">
51-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
44+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.1.0" />
45+
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
46+
<PackageVersion Include="Microsoft.Testing.Extensions.HangDump" Version="$(MicrosoftTestingPlatformVersion)" />
47+
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
5248
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
53-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
54-
<PackageVersion Include="xunit" Version="2.9.3" />
49+
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.1" />
5550
</ItemGroup>
5651
<ItemGroup>
5752
<GlobalPackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="$(CodeAnalysisAnalyzerVersion)" />

azure-pipelines/Merge-CodeCoverage.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ try {
2828
if ($reports) {
2929
$reports |% { $_.FullName } |% {
3030
# In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not.
31+
Write-Verbose "Processing $_"
3132
$xml = [xml](Get-Content -LiteralPath $_)
3233
$xml.coverage.packages.package.classes.class |? { $_.filename} |% {
3334
$_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar)

global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"sdk": {
3-
"version": "10.0.100",
3+
"version": "10.0.101",
44
"rollForward": "patch",
55
"allowPrerelease": false
66
},
7+
"test": {
8+
"runner": "Microsoft.Testing.Platform"
9+
},
710
"msbuild-sdks": {
811
"MSBuild.Sdk.Extras": "3.0.44",
912
"Microsoft.Build.NoTargets": "3.7.134",

src/Microsoft.VisualStudio.Threading/ListOfOftenOne`1.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Diagnostics;
7-
using System.Linq;
8-
using System.Text;
96
using System.Threading;
10-
using System.Threading.Tasks;
117

128
namespace Microsoft.VisualStudio.Threading;
139

src/Microsoft.VisualStudio.Threading/WeakKeyDictionary`2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
214214
/// </summary>
215215
internal bool Any()
216216
{
217-
foreach (KeyValuePair<WeakKeyDictionary<TKey, TValue>.WeakReference<TKey>, TValue> item in this.dictionary)
217+
foreach (KeyValuePair<WeakReference<TKey>, TValue> item in this.dictionary)
218218
{
219219
if (item.Key.IsAlive)
220220
{

test/.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ dotnet_diagnostic.SA1401.severity = silent
8080

8181
# SA1133: Do not combine attributes
8282
dotnet_diagnostic.SA1133.severity = silent
83+
84+
# xUnit1051: Use TestContext.Current.CancellationToken
85+
dotnet_diagnostic.xUnit1051.severity = suggestion

test/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />
44

55
<PropertyGroup>
6-
<IsTestProject>true</IsTestProject>
76
<IsPackable>false</IsPackable>
87
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
8+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
99
</PropertyGroup>
1010

1111
<ItemGroup>

test/Directory.Build.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3+
<ItemGroup Condition="'$(IsTestProject)' != 'false'">
4+
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
5+
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" />
6+
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" />
7+
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
8+
</ItemGroup>
39
<ItemGroup>
410
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Condition="Exists('xunit.runner.json')" />
511
</ItemGroup>

test/Directory.Packages.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />
4+
5+
<PropertyGroup>
6+
<CodeAnalysisVersionForTests>4.13.0</CodeAnalysisVersionForTests>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageVersion Update="Microsoft.CodeAnalysis" Version="$(CodeAnalysisVersionForTests)" />
10+
<PackageVersion Update="Microsoft.CodeAnalysis.Common" Version="$(CodeAnalysisVersionForTests)" />
11+
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="$(CodeAnalysisVersionForTests)" />
12+
<PackageVersion Update="Microsoft.CodeAnalysis.VisualBasic" Version="$(CodeAnalysisVersionForTests)" />
13+
</ItemGroup>
14+
</Project>

test/IsolatedTestHost/App.config

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
33
<runtime>
4-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5-
<dependentAssembly>
6-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
8-
</dependentAssembly>
9-
</assemblyBinding>
4+
105
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
116
<dependentAssembly>
127
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
138
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
149
</dependentAssembly>
1510
</assemblyBinding>
16-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
17-
<dependentAssembly>
18-
<assemblyIdentity name="xunit.core" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
19-
<bindingRedirect oldVersion="0.0.0.0-2.9.3.0" newVersion="2.9.3.0" />
20-
</dependentAssembly>
21-
</assemblyBinding>
22-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
23-
<dependentAssembly>
24-
<assemblyIdentity name="xunit.execution.desktop" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
25-
<bindingRedirect oldVersion="0.0.0.0-2.9.2.0" newVersion="2.9.2.0" />
26-
</dependentAssembly>
27-
</assemblyBinding>
2811
</runtime>
2912
</configuration>

0 commit comments

Comments
 (0)