]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
sg-report-flight: Sort email output by results, not job name
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 31 Mar 2015 13:49:42 +0000 (13:49 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 31 Mar 2015 13:49:42 +0000 (13:49 +0000)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
sg-report-flight

index d2aff58a724f87dfa32a08fe2ddb6d805e4cdafa..2adc8a87d0566b2d2417fa8a89e9b690e741d93b 100755 (executable)
@@ -541,16 +541,21 @@ END
 
         my $text= (sprintf" %-${jl}s %2s %-${sl}s %-${rl}s ",
                    $j->{job}, $s->{stepno}, $s->{testid}, $s->{status});
-        $text .= "in $failv->{Flight} " if $heisenflightp;
-        $text .= $failv->{Summary} if defined $failv->{Summary};
+       my $xstatus = '';
+        $xstatus .= "in $failv->{Flight} " if $heisenflightp;
+        $xstatus .= $failv->{Summary} if defined $failv->{Summary};
+       $text .= $xstatus;
         $text =~ s/ *$//;
         while (length($text) > $cw) { last unless $text =~ s/(.* ) /$1/; }
 
-        $notsucceeds{$cat} .= $text."\n";
+       push @{ $notsucceeds{$cat} }, [ "$s->{status} $xstatus", $text ];
     }
     foreach my $cat (sort keys %notsucceeds) {
         $cat =~ m/^\w+ / or die;
-        print "\n$'\n$notsucceeds{$cat}" or die $!;
+        print "\n$'\n" or die $!;
+       foreach (sort { $a->[0] cmp $b->[0] } @{ $notsucceeds{$cat} }) {
+           print $_->[1], "\n" or die $!;
+       }
     }
 
     if (!%{ $r->{Failures} }) {