@@ -449,23 +449,19 @@ export async function mergeJUnitReports(args: {
449449 } ) )
450450 ) ;
451451 const fileGroups : FileGroup [ ] = [ ] ;
452- const skippedFiles : string [ ] = [ ] ;
453452 for ( const { filename, content } of contents ) {
454453 if ( XMLValidator . validate ( content ) !== true ) {
455- skippedFiles . push ( filename ) ;
456- continue ;
454+ throw new Error ( `mergeJUnitReports: invalid XML in ${ filename } ` ) ;
457455 }
458456 let parsed : any ;
459457 try {
460458 parsed = xmlParser . parse ( content ) ;
461- } catch {
462- skippedFiles . push ( filename ) ;
463- continue ;
459+ } catch ( err ) {
460+ throw new Error ( `mergeJUnitReports: failed to parse ${ filename } ` , { cause : err } ) ;
464461 }
465462 const testsuites = parsed ?. testsuites ?. testsuite ;
466463 if ( ! Array . isArray ( testsuites ) ) {
467- skippedFiles . push ( filename ) ;
468- continue ;
464+ throw new Error ( `mergeJUnitReports: no <testsuite> array in ${ filename } ` ) ;
469465 }
470466 const match = filename . match ( ATTEMPT_PATTERN ) ;
471467 const attemptIndex = match ? parseInt ( match [ 1 ] , 10 ) : 0 ;
@@ -486,18 +482,11 @@ export async function mergeJUnitReports(args: {
486482 }
487483 }
488484 if ( testcasesByName . size === 0 ) {
489- skippedFiles . push ( filename ) ;
490- continue ;
485+ throw new Error ( `mergeJUnitReports: no parseable testcases in ${ filename } ` ) ;
491486 }
492487 fileGroups . push ( { attemptIndex, filename, content, testcasesByName } ) ;
493488 }
494489
495- if ( skippedFiles . length > 0 ) {
496- throw new Error (
497- `mergeJUnitReports: no parseable testcases found in ${ skippedFiles . join ( ', ' ) } `
498- ) ;
499- }
500-
501490 // Single attempt: copy the original XML so suite-level metadata (testsuite
502491 // attributes, <system-out>, etc.) survives. The rebuild path below would
503492 // collapse those to a single attribute-less <testsuite>.
0 commit comments