Use dotnet test since the dotnet xunit test runner has been deprecated (#7980)

This commit is contained in:
Christoph Bergmeister [MVP] 2018-10-10 04:55:41 +01:00 committed by Travis Plunk
parent 339abe0609
commit fe731eda14
3 changed files with 10 additions and 14 deletions

View File

@ -1369,13 +1369,6 @@ function Start-PSxUnit {
throw "PowerShell must be built before running tests!"
}
if (Test-Path $SequentialTestResultsFile) {
Remove-Item $SequentialTestResultsFile -Force -ErrorAction SilentlyContinue
}
if (Test-Path $ParallelTestResultsFile) {
Remove-Item $ParallelTestResultsFile -Force -ErrorAction SilentlyContinue
}
try {
Push-Location $PSScriptRoot/test/csharp
@ -1413,8 +1406,10 @@ function Start-PSxUnit {
}
# Run sequential tests first, and then run the tests that can execute in parallel
dotnet xunit -configuration $Options.configuration -xml $SequentialTestResultsFile -namespace "PSTests.Sequential" -parallel none
if (Test-Path $SequentialTestResultsFile) {
Remove-Item $SequentialTestResultsFile -Force -ErrorAction SilentlyContinue
}
dotnet test --configuration $Options.configuration --filter FullyQualifiedName~PSTests.Sequential -p:ParallelizeTestCollections=false --test-adapter-path:. "--logger:xunit;LogFilePath=$SequentialTestResultsFile"
Publish-TestResults -Path $SequentialTestResultsFile -Type 'XUnit' -Title 'Xunit Sequential'
$extraParams = @()
@ -1430,7 +1425,10 @@ function Start-PSxUnit {
)
}
dotnet xunit -configuration $Options.configuration -xml $ParallelTestResultsFile -namespace "PSTests.Parallel" -nobuild @extraParams
if (Test-Path $ParallelTestResultsFile) {
Remove-Item $ParallelTestResultsFile -Force -ErrorAction SilentlyContinue
}
dotnet test --configuration $Options.configuration --filter FullyQualifiedName~PSTests.Parallel --no-build --test-adapter-path:. "--logger:xunit;LogFilePath=$ParallelTestResultsFile"
Publish-TestResults -Path $ParallelTestResultsFile -Type 'XUnit' -Title 'Xunit Parallel'
}
finally {

View File

@ -24,8 +24,7 @@
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Xunit.SkippableFact" Version="1.3.12" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<!-- DotNetCliToolReference element specifies the CLI tool that the user wants to restore in the context of the project. -->
<DotNetCliToolReference Include="dotnet-xunit" Version="2.4.0-beta.1.build3958" />
<PackageReference Include="XunitXml.TestLogger" Version="2.0.0" />
</ItemGroup>
</Project>

View File

@ -16,8 +16,7 @@
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.0" />
<!-- DotNetCliToolReference element specifies the CLI tool that the user wants to restore in the context of the project. -->
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="XunitXml.TestLogger" Version="2.0.0" />
<!-- The version of Microsoft.PowerShell.SDK should be the version we are releasing, so the tests use the correct SDK before publishing to NuGet.org -->
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.1.0" />
<PackageReference Include="Xunit.SkippableFact" Version="1.3.6" />