@@ -9,6 +9,8 @@ export interface ActualTestResult {
9
9
name : string
10
10
totalCount : number
11
11
skippedCount : number
12
+ failedCount : number
13
+ passedCount : number
12
14
retriedCount : number
13
15
annotations : Annotation [ ]
14
16
globalAnnotations : Annotation [ ]
@@ -18,6 +20,8 @@ export interface ActualTestResult {
18
20
interface TestCasesResult {
19
21
totalCount : number
20
22
skippedCount : number
23
+ failedCount : number
24
+ passedCount : number
21
25
retriedCount : number
22
26
annotations : Annotation [ ]
23
27
}
@@ -283,6 +287,8 @@ async function parseSuite(
283
287
284
288
let totalCount = 0
285
289
let skippedCount = 0
290
+ let failedCount = 0
291
+ let passedCount = 0
286
292
let retriedCount = 0
287
293
const annotations : Annotation [ ] = [ ]
288
294
@@ -314,6 +320,8 @@ async function parseSuite(
314
320
// expand global annotations array
315
321
totalCount += parsedTestCases . totalCount
316
322
skippedCount += parsedTestCases . skippedCount
323
+ failedCount += parsedTestCases . failedCount
324
+ passedCount += parsedTestCases . passedCount
317
325
retriedCount += parsedTestCases . retriedCount
318
326
annotations . push ( ...parsedTestCases . annotations )
319
327
globalAnnotations . push ( ...parsedTestCases . annotations )
@@ -324,6 +332,8 @@ async function parseSuite(
324
332
name : suiteName ,
325
333
totalCount,
326
334
skippedCount,
335
+ failedCount,
336
+ passedCount,
327
337
retriedCount,
328
338
annotations,
329
339
globalAnnotations,
@@ -366,6 +376,8 @@ async function parseSuite(
366
376
childSuiteResults . push ( childSuiteResult )
367
377
totalCount += childSuiteResult . totalCount
368
378
skippedCount += childSuiteResult . skippedCount
379
+ failedCount += childSuiteResult . failedCount
380
+ passedCount += childSuiteResult . passedCount
369
381
retriedCount += childSuiteResult . retriedCount
370
382
}
371
383
@@ -375,6 +387,8 @@ async function parseSuite(
375
387
name : suiteName ,
376
388
totalCount,
377
389
skippedCount,
390
+ failedCount,
391
+ passedCount,
378
392
retriedCount,
379
393
annotations,
380
394
globalAnnotations,
@@ -387,6 +401,8 @@ async function parseSuite(
387
401
name : suiteName ,
388
402
totalCount,
389
403
skippedCount,
404
+ failedCount,
405
+ passedCount,
390
406
retriedCount,
391
407
annotations,
392
408
globalAnnotations,
@@ -582,9 +598,13 @@ async function parseTestCases(
582
598
if ( limit >= 0 && annotations . length >= limit ) break
583
599
}
584
600
601
+ const failedCount = annotations . filter ( a => a . annotation_level === 'failure' ) . length
602
+ const passedCount = totalCount - failedCount - skippedCount
585
603
return {
586
604
totalCount,
587
605
skippedCount,
606
+ failedCount,
607
+ passedCount,
588
608
retriedCount,
589
609
annotations
590
610
}
@@ -622,6 +642,8 @@ export async function parseTestReports(
622
642
const testResults : ActualTestResult [ ] = [ ]
623
643
let totalCount = 0
624
644
let skipped = 0
645
+ let failed = 0
646
+ let passed = 0
625
647
let retried = 0
626
648
let foundFiles = 0
627
649
for await ( const file of globber . globGenerator ( ) ) {
@@ -648,9 +670,11 @@ export async function parseTestReports(
648
670
)
649
671
650
672
if ( ! testResult ) continue
651
- const { totalCount : c , skippedCount : s , retriedCount : r } = testResult
673
+ const { totalCount : c , skippedCount : s , failedCount : f , passedCount : p , retriedCount : r } = testResult
652
674
totalCount += c
653
675
skipped += s
676
+ failed += f
677
+ passed += p
654
678
retried += r
655
679
testResults . push ( testResult )
656
680
@@ -659,10 +683,6 @@ export async function parseTestReports(
659
683
}
660
684
}
661
685
662
- // get the count of passed and failed tests.
663
- const failed = globalAnnotations . filter ( a => a . annotation_level === 'failure' ) . length
664
- const passed = totalCount - failed - skipped
665
-
666
686
return {
667
687
checkName,
668
688
summary,
0 commit comments