Get-CatTestResultSummary
Returns the summary of the last run in this session — counts, rates, duration, and the per-test results — as one object. The object to check in a script.
On this page
Synopsis
Get-CatTestResultSummary
Parameters
None (common parameters only).
What it does
Writes the summary CAT kept from the last Invoke-CatProject / Invoke-CatTest in this session; before any run it returns nothing. This is how a script decides whether the run was good — neither Invoke-* cmdlet fails on failed tests.
Output
One TestExecutionSummary object: TotalCount, PassedCount, FailedCount, ErrorCount, InconclusiveCount, SkippedCount, PassRate, FailedRate, ErrorRate, InconclusiveRate (percent), StartedOn, FinishedOn, Duration, ExecutionGuid, and Results — the same items Get-CatTestResult returns. Inconclusive is a test CAT could not bring to a verdict, not a failure.
Errors
There is no CAT session active… when no session exists.
Examples
Invoke-CatProject -Path 'D:\Testing\DwhTests.cat.yaml'
$s = Get-CatTestResultSummary
"$($s.PassedCount)/$($s.TotalCount) passed, $($s.PassRate) %"
if ($s.FailedCount -gt 0 -or $s.ErrorCount -gt 0) { exit 1 } # fail the pipeline
Related
- Introduction — session model, logging, errors, sign-in.
Invoke-CatTest— returns this object directly.Get-CatTestResult·Show-CatTestResultSummary.