chore: retain case counts for failed Unity verification
This commit is contained in:
+2
-2
@@ -25,14 +25,14 @@ try {
|
|||||||
$record.command = 'unity ' + (($cliArgs | ForEach-Object { '"' + $_ + '"' }) -join ' ')
|
$record.command = 'unity ' + (($cliArgs | ForEach-Object { '"' + $_ + '"' }) -join ' ')
|
||||||
& unity @cliArgs
|
& unity @cliArgs
|
||||||
$record.exitCode = $LASTEXITCODE
|
$record.exitCode = $LASTEXITCODE
|
||||||
if ($LASTEXITCODE -ne 0) { throw "Unity $Phase exited $LASTEXITCODE. See $logPath" }
|
if (!(Test-Path -LiteralPath $xmlPath)) { throw "Unity $Phase exited $($record.exitCode) without a test report. See $logPath" }
|
||||||
if (!(Test-Path -LiteralPath $xmlPath)) { throw 'Unity did not write a test report.' }
|
|
||||||
[xml]$report = Get-Content -LiteralPath $xmlPath -Raw
|
[xml]$report = Get-Content -LiteralPath $xmlPath -Raw
|
||||||
$cases = @($report.SelectNodes('//test-case'))
|
$cases = @($report.SelectNodes('//test-case'))
|
||||||
$record.total = $cases.Count
|
$record.total = $cases.Count
|
||||||
$record.passed = @($cases | Where-Object { $_.result -eq 'Passed' }).Count
|
$record.passed = @($cases | Where-Object { $_.result -eq 'Passed' }).Count
|
||||||
$record.failed = @($cases | Where-Object { $_.result -eq 'Failed' }).Count
|
$record.failed = @($cases | Where-Object { $_.result -eq 'Failed' }).Count
|
||||||
$record.notPassed = $record.total - $record.passed
|
$record.notPassed = $record.total - $record.passed
|
||||||
|
if ($record.exitCode -ne 0) { throw "Unity $Phase exited $($record.exitCode). See $logPath" }
|
||||||
if ($record.total -eq 0 -or $record.notPassed -ne 0) { throw "Test report contains $($record.total) tests and $($record.notPassed) non-passing cases." }
|
if ($record.total -eq 0 -or $record.notPassed -ne 0) { throw "Test report contains $($record.total) tests and $($record.notPassed) non-passing cases." }
|
||||||
} elseif ($Phase -eq 'AndroidBuild') {
|
} elseif ($Phase -eq 'AndroidBuild') {
|
||||||
New-Item -ItemType Directory -Path (Split-Path $apkPath -Parent) -Force | Out-Null
|
New-Item -ItemType Directory -Path (Split-Path $apkPath -Parent) -Force | Out-Null
|
||||||
|
|||||||
Reference in New Issue
Block a user