Skip to content

Commit 67793bf

Browse files
authored
Eradicate Nunit (dotnet#17782)
1 parent 2812497 commit 67793bf

File tree

9 files changed

+11
-27
lines changed

9 files changed

+11
-27
lines changed

Directory.Build.targets

+1-7
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@
1010
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(NETCoreSdkPortableRuntimeIdentifier)/fsyacc.dll</FsYaccPath>
1111
</PropertyGroup>
1212

13-
<ItemGroup Condition="'$(UnitTestType)' == 'nunit'">
14-
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
15-
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnit3TestAdapterVersion)" />
16-
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
17-
</ItemGroup>
18-
1913
<ItemGroup Condition="'$(UnitTestType)' == 'xunit'">
2014
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
2115
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVersion)" />
22-
<PackageReference Include="NunitXml.TestLogger" Version="$(NunitXmlTestLoggerVersion)" />
16+
<PackageReference Include="XunitXml.TestLogger" Version="$(XunitXmlTestLoggerVersion)" />
2317
</ItemGroup>
2418

2519
<!--

azure-pipelines-PR.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ stages:
487487
- task: PublishTestResults@2
488488
displayName: Publish Test Results
489489
inputs:
490-
testResultsFormat: 'NUnit'
490+
testResultsFormat: 'XUnit'
491491
testResultsFiles: '*.xml'
492492
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)'
493493
continueOnError: true
@@ -557,7 +557,7 @@ stages:
557557
- task: PublishTestResults@2
558558
displayName: Publish Test Results
559559
inputs:
560-
testResultsFormat: 'NUnit'
560+
testResultsFormat: 'XUnit'
561561
testResultsFiles: '*.xml'
562562
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
563563
continueOnError: true
@@ -600,7 +600,7 @@ stages:
600600
- task: PublishTestResults@2
601601
displayName: Publish Test Results
602602
inputs:
603-
testResultsFormat: 'NUnit'
603+
testResultsFormat: 'XUnit'
604604
testResultsFiles: '*.xml'
605605
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
606606
continueOnError: true

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ extends:
143143
- task: PublishTestResults@2
144144
displayName: Publish Test Results
145145
inputs:
146-
testResultsFormat: 'NUnit'
146+
testResultsFormat: 'XUnit'
147147
testResultsFiles: '*.xml'
148148
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
149149
continueOnError: true

eng/Build.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
368368
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject)
369369
$testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml"
370370
$testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog"
371-
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""nunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
371+
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
372372
$args += " --blame --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=false"
373373

374374
if (-not $noVisualStudio -or $norestore) {
@@ -383,7 +383,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
383383
Write-Host("Starting on the background: $args")
384384
Write-Host("------------------------------------")
385385
$bgJob = Start-Job -ScriptBlock {
386-
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "nunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
386+
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "xunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
387387
if ($LASTEXITCODE -ne 0) {
388388
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
389389
}

eng/Versions.props

+1-4
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,12 @@
186186
<MicrosoftNETCoreILAsmVersion>5.0.0-preview.7.20364.11</MicrosoftNETCoreILAsmVersion>
187187
<MicrosoftNETTestSdkVersion>17.4.0</MicrosoftNETTestSdkVersion>
188188
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
189-
<NUnitVersion>3.13.2</NUnitVersion>
190-
<NUnit3TestAdapterVersion>4.1.0</NUnit3TestAdapterVersion>
191-
<NUnitLiteVersion>3.11.0</NUnitLiteVersion>
192-
<NunitXmlTestLoggerVersion>2.1.80</NunitXmlTestLoggerVersion>
193189
<RoslynToolsSignToolVersion>1.0.0-beta2-dev3</RoslynToolsSignToolVersion>
194190
<StreamJsonRpcVersion>2.18.48</StreamJsonRpcVersion>
195191
<NerdbankStreamsVersion>2.10.69</NerdbankStreamsVersion>
196192
<XUnitVersion>2.9.0</XUnitVersion>
197193
<XUnitRunnerVersion>2.8.2</XUnitRunnerVersion>
194+
<XunitXmlTestLoggerVersion>3.1.17</XunitXmlTestLoggerVersion>
198195
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
199196
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
200197
<!-- -->

eng/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function Test() {
214214
projectname=$(basename -- "$testproject")
215215
projectname="${projectname%.*}"
216216
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
217-
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
217+
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
218218
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
219219
}
220220

tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<IsPackable>false</IsPackable>
88
<DefineConstants>NO_GENERATIVE</DefineConstants>
99
<FSharpCoreImplicitPackageVersion>$(FSharpCoreShippedPackageVersionValue)</FSharpCoreImplicitPackageVersion>
10+
<UnitTestType>xunit</UnitTestType>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
@@ -21,8 +22,6 @@
2122
</Content>
2223
<PackageReference Include="BasicProvider" Version="1.0.0" />
2324
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
24-
<PackageReference Include="xunit" Version="2.4.2" />
25-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
2625
</ItemGroup>
2726

2827
<Target Name="RemovePackagesFromCache" BeforeTargets="Restore">

tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<IsPackable>false</IsPackable>
88
<FSharpCoreImplicitPackageVersion>$(FSharpCoreShippedPackageVersionValue)</FSharpCoreImplicitPackageVersion>
99
<DefineConstants>NO_GENERATIVE</DefineConstants>
10+
<UnitTestType>xunit</UnitTestType>
1011
</PropertyGroup>
1112

1213
<ItemGroup>
@@ -18,8 +19,6 @@
1819

1920
<PackageReference Include="ComboProvider" Version="1.0.0" />
2021
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
21-
<PackageReference Include="xunit" Version="2.4.2" />
22-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
2322
</ItemGroup>
2423

2524
<Target Name="RemovePackagesFromCache" BeforeTargets="Restore">

tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj

-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
<TailCalls>true</TailCalls>
2626
</PropertyGroup>
2727

28-
<PropertyGroup>
29-
<DefineConstants Condition="'$(UnitTestType)' == 'xunit'">$(DefineConstants);XUNIT</DefineConstants>
30-
<DefineConstants Condition="'$(UnitTestType)' != 'xunit'">$(DefineConstants);NUNIT</DefineConstants>
31-
</PropertyGroup>
32-
3328
<ItemGroup>
3429
<Compile Include="TestFrameworkHelpers.fs" />
3530
<Compile Include="LibraryTestFx.fs" />

0 commit comments

Comments
 (0)