Skip to content

Commit

Permalink
Support JUnit format for Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 31, 2020
1 parent ff0c784 commit 81f5573
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,28 @@ if($target -eq "test") {
}

if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) {
$env:FOLDER = $builds[$Build]['Folder']
Invoke-Pester -Path tests -EnableExit
$folder = $builds[$Build]['Folder']
$env:FOLDER = $folder
New-Item -Path ".\target\$folder" -Type Directory
Invoke-Pester -Path tests -EnableExit -OutputFile ".\target\$folder\junit-results.xml" -OutputFormat JUnitXml
Remove-Item -Force env:\FOLDER
} else {
foreach($b in $builds.Keys) {
$env:FOLDER = $builds[$b]['Folder']
Invoke-Pester -Path tests -EnableExit
$folder = $builds[$b]['Folder']
$env:FOLDER = $folder
New-Item -Path ".\target\$folder" -Type Directory
Invoke-Pester -Path tests -EnableExit -OutputFile ".\target\$folder\junit-results.xml" -OutputFormat JUnitXml
Remove-Item -Force env:\FOLDER
}
}
}

## Debugging purposes
Get-ChildItem -Recurse -Include junit-results.xml -Directory | ForEach-Object {
$match = $_.FullName
Write-Host "Test report generated in $match"
}

if($target -eq "publish") {
if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) {
foreach($tag in $Builds[$Build]['Tags']) {
Expand Down

0 comments on commit 81f5573

Please sign in to comment.