Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = @()
Expand All @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions test/csharp/csharp.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
3 changes: 1 addition & 2 deletions test/hosting/hosting.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down