@@ -197,7 +197,8 @@ export async function parseFile(
197
197
annotationsLimit = - 1 ,
198
198
truncateStackTraces = true ,
199
199
failOnParseError = false ,
200
- globalAnnotations : Annotation [ ] = [ ]
200
+ globalAnnotations : Annotation [ ] = [ ] ,
201
+ resolveIgnoreClassname = false
201
202
) : Promise < ActualTestResult | undefined > {
202
203
core . debug ( `Parsing file ${ file } ` )
203
204
@@ -236,7 +237,8 @@ export async function parseFile(
236
237
followSymlink ,
237
238
annotationsLimit ,
238
239
truncateStackTraces ,
239
- globalAnnotations
240
+ globalAnnotations ,
241
+ resolveIgnoreClassname
240
242
)
241
243
}
242
244
@@ -260,7 +262,8 @@ async function parseSuite(
260
262
followSymlink : boolean ,
261
263
annotationsLimit : number ,
262
264
truncateStackTraces : boolean ,
263
- globalAnnotations : Annotation [ ]
265
+ globalAnnotations : Annotation [ ] ,
266
+ resolveIgnoreClassname = false
264
267
) : Promise < ActualTestResult | undefined > {
265
268
if ( ! suite ) {
266
269
// not a valid suite, return fast
@@ -298,7 +301,8 @@ async function parseSuite(
298
301
transformer ,
299
302
followSymlink ,
300
303
truncateStackTraces ,
301
- limit
304
+ limit ,
305
+ resolveIgnoreClassname
302
306
)
303
307
304
308
// expand global annotations array
@@ -348,7 +352,8 @@ async function parseSuite(
348
352
followSymlink ,
349
353
annotationsLimit ,
350
354
truncateStackTraces ,
351
- globalAnnotations
355
+ globalAnnotations ,
356
+ resolveIgnoreClassname
352
357
)
353
358
354
359
if ( childSuiteResult ) {
@@ -398,7 +403,8 @@ async function parseTestCases(
398
403
transformer : Transformer [ ] ,
399
404
followSymlink : boolean ,
400
405
truncateStackTraces : boolean ,
401
- limit = - 1
406
+ limit = - 1 ,
407
+ resolveIgnoreClassname = false
402
408
) : Promise < TestCasesResult > {
403
409
const annotations : Annotation [ ] = [ ]
404
410
let totalCount = 0
@@ -488,10 +494,15 @@ async function parseTestCases(
488
494
testcase . _attributes . name
489
495
) . trim ( )
490
496
497
+ let resolveClassname = testcase . _attributes . name
498
+ if ( ! resolveIgnoreClassname && testcase . _attributes . classname ) {
499
+ resolveClassname = testcase . _attributes . classname
500
+ }
501
+
491
502
const pos = await resolveFileAndLine (
492
503
testcase . _attributes . file || failure ?. _attributes ?. file || suiteFile ,
493
504
testcase . _attributes . line || failure ?. _attributes ?. line || suiteLine ,
494
- testcase . _attributes . classname ? testcase . _attributes . classname : testcase . _attributes . name ,
505
+ resolveClassname ,
495
506
stackTrace
496
507
)
497
508
@@ -530,7 +541,11 @@ async function parseTestCases(
530
541
. replace ( templateVar ( 'TEST_NAME' ) , testcase . _attributes . name )
531
542
. replace ( templateVar ( 'CLASS_NAME' ) , className )
532
543
} else if ( pos . fileName !== testcase . _attributes . name ) {
533
- title = `${ pos . fileName } .${ testcase . _attributes . name } `
544
+ if ( resolveIgnoreClassname && testcase . _attributes . classname ) {
545
+ title = `${ testcase . _attributes . classname } .${ testcase . _attributes . name } `
546
+ } else {
547
+ title = `${ pos . fileName } .${ testcase . _attributes . name } `
548
+ }
534
549
} else {
535
550
title = `${ testcase . _attributes . name } `
536
551
}
@@ -591,7 +606,8 @@ export async function parseTestReports(
591
606
followSymlink = false ,
592
607
annotationsLimit = - 1 ,
593
608
truncateStackTraces = true ,
594
- failOnParseError = false
609
+ failOnParseError = false ,
610
+ resolveIgnoreClassname = false
595
611
) : Promise < TestResult > {
596
612
core . debug ( `Process test report for: ${ reportPaths } (${ checkName } )` )
597
613
const globber = await glob . create ( reportPaths , { followSymbolicLinks : followSymlink } )
@@ -620,7 +636,8 @@ export async function parseTestReports(
620
636
annotationsLimit ,
621
637
truncateStackTraces ,
622
638
failOnParseError ,
623
- globalAnnotations
639
+ globalAnnotations ,
640
+ resolveIgnoreClassname
624
641
)
625
642
626
643
if ( ! testResult ) continue
0 commit comments