@@ -532,18 +532,12 @@ fn run(cli: Cli) -> ExitCode {
532532 . chain ( other_entries_by_test)
533533 . filter_map ( |( test_path, test_entry) | {
534534 fn reconcile < Out > (
535- entry : Entry < Out > ,
535+ meta_props : & mut TestProps < Out > ,
536+ reported : BTreeMap < Platform , BTreeMap < BuildProfile , Expected < Out > > > ,
536537 preset : ReportProcessingPreset ,
537- ) -> TestProps < Out >
538- where
538+ ) where
539539 Out : Debug + Default + EnumSetType ,
540540 {
541- let Entry {
542- meta_props,
543- reported,
544- } = entry;
545-
546- let mut meta_props = meta_props. unwrap_or_default ( ) ;
547541 let reconciled = ' resolve: {
548542 let reported = |platform, build_profile| {
549543 reported
@@ -587,19 +581,22 @@ fn run(cli: Cli) -> ExitCode {
587581 }
588582 } ;
589583 meta_props. expected = Some ( reconciled) ;
590- meta_props
591584 }
592585
593586 let TestEntry {
594- entry : test_entry,
587+ entry :
588+ Entry {
589+ meta_props : properties,
590+ reported : mut test_reported,
591+ } ,
595592 subtests : subtest_entries,
596593 } = test_entry;
597594
598- if test_entry . meta_props . is_none ( ) {
595+ if properties . is_none ( ) {
599596 log:: info!( "new test entry: {test_path:?}" )
600597 }
601598
602- if test_entry . reported . is_empty ( ) && using_reports {
599+ if test_reported . is_empty ( ) && using_reports {
603600 let test_path = & test_path;
604601 let msg = lazy_format ! ( "no entries found in reports for {:?}" , test_path) ;
605602 match preset {
@@ -612,7 +609,44 @@ fn run(cli: Cli) -> ExitCode {
612609 }
613610 }
614611
615- let properties = reconcile ( test_entry, preset) ;
612+ let mut properties = properties. unwrap_or_default ( ) ;
613+
614+ for ( platform, build_profile, reported) in
615+ test_reported. iter_mut ( ) . flat_map ( |( p, by_bp) | {
616+ by_bp
617+ . iter_mut ( )
618+ . map ( move |( bp, reported) | ( p, bp, reported) )
619+ } )
620+ {
621+ let skip = TestOutcome :: Skip ;
622+ // Ignore `SKIP` outcomes if we have non-`SKIP` outcomes here.
623+ //
624+ // Do this so that test runs whose coverage _in aggregate_ includes actual
625+ // runs on this test are viable for processing. Otherwise, we'd have `SKIP`
626+ // outcomes be included that aren't actually wanted.
627+ if * reported != skip {
628+ let skip = skip. into ( ) ;
629+ if reported. inner ( ) . is_superset ( skip) {
630+ log:: debug!(
631+ concat!(
632+ "encountered `{}` among other outcomes " ,
633+ "in aggregation of reported test outcomes " ,
634+ "for {:?} with platform {:?} and build profile {:?}, " ,
635+ " removing with the assumption that " ,
636+ "this is an artifact of disjoint test runs"
637+ ) ,
638+ skip,
639+ test_path,
640+ platform,
641+ build_profile,
642+ ) ;
643+ * reported = Expected :: new ( reported. inner ( ) & !skip)
644+ . expect ( "internal error: empty non-`SKIP` superset" ) ;
645+ }
646+ }
647+ }
648+
649+ reconcile ( & mut properties, test_reported, preset) ;
616650
617651 let mut subtests = BTreeMap :: new ( ) ;
618652 for ( subtest_name, subtest) in subtest_entries {
@@ -622,8 +656,13 @@ fn run(cli: Cli) -> ExitCode {
622656 log:: error!( "internal error: duplicate test path {test_path:?}" ) ;
623657 }
624658
625- let mut properties = reconcile ( subtest, preset) ;
659+ let Entry {
660+ meta_props : properties,
661+ reported : subtest_reported,
662+ } = subtest;
626663
664+ let mut properties = properties. unwrap_or_default ( ) ;
665+ reconcile ( & mut properties, subtest_reported, preset) ;
627666 for ( _, expected) in properties. expected . as_mut ( ) . unwrap ( ) . iter_mut ( ) {
628667 taint_subtest_timeouts_by_suspicion ( expected) ;
629668 }
0 commit comments