Commit 2de7450
fix(build): count passed and failed, not merely discovered, tests
Follow-up to the previous gate, which used TotalCount minus NotRunCount.
That misses a suite where every test is skipped: skipped tests are neither
NotRun nor executed-with-a-result, so the subtraction stays positive and
the build passes having run nothing.
Measured against Pester 6.1.0:
empty test directory Total 0 Passed 0 Failed 0 Skipped 0 NotRun 0
filter matching no test Total 120 Passed 0 Failed 0 Skipped 0 NotRun 120
every test -Skip Total 3 Passed 0 Failed 0 Skipped 3 NotRun 0
Filtering on the per-test .Executed property does not distinguish the
third case either -- skipped tests report Executed = $true. Only
PassedCount plus FailedCount separates a suite that ran from one that
did not, so the gate uses that.
Verified all three: all-skipped exits 1, empty directory exits 1, and a
normal run with two legitimate skips reports 118 passed and exits 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G1CarQG8VibNFxw4cN53Zs1 parent a8a298b commit 2de7450
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
| |||
0 commit comments