Support minor upgrades.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 2 Jul 2012 20:50:45 +0000 (22:50 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 2 Jul 2012 20:50:45 +0000 (22:50 +0200)
matrixgen.pl

index 4ad71d2..04e7918 100755 (executable)
@@ -2,7 +2,7 @@
 use strict;
 use POSIX qw(strftime);
 
-my ($list, @list, %list, $item, @item, %item, $result, %platforms, %components, %ins, %upg, $now, $n_platforms, $width);
+my ($list, @list, %list, $item, @item, %item, $result, $done, %platforms, %components, $now, $n_platforms, $width);
 my (%list_perf);
 
 
@@ -56,6 +56,7 @@ $list=`ls -1 | egrep '^(gridsite|lb|px|canl)'`;
 
 #$list{install} = ();
 #$list{upgrade} = ();
+#$list{'minor-upgrade'} = ();
 foreach my $i (0..$#list) {
        my ($plat, $scen, $date);
 
@@ -77,7 +78,8 @@ foreach my $i (0..$#list) {
                close FH;
                chomp;
                if (/perf/i) { $scen = $_; }
-               elsif (/upgrade/i) { $scen = 'upgrade'; }
+               elsif (/^upgrade/i or /major upgrade/i) { $scen = 'upgrade'; }
+               elsif (/^minor upgrade/i) { $scen = 'minor-upgrade'; }
                elsif (/build/i) { $scen = 'build'; }
        }
        
@@ -110,6 +112,7 @@ foreach my $s (keys %list) {
 
 #printf STDERR "$item->{component}, $item->{platform}\n";
                        undef $result;
+                       undef $done;
                        if (-f "$item->{dir}/report.twiki") {
                                my ($section, $err, $yaim_used, $yaim_finished);
                                `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`;
@@ -124,12 +127,18 @@ foreach my $s (keys %list) {
                                if ($section == 0 && ($yaim_used != 0 || $yaim_finished == 0)) {
                                        $result=`grep -- '-TEST FAILED-' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
                                        chomp $result;
+                                       $done=`grep -- '<font color="green">done</font>' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
+                                       chomp $done;
                                } else {
                                        if ($section == 0) { $result = 'Error'; }
                                        else { $result = 'Failed'; }
                                }
-                       } else { undef $result; }
+                       }
                        $item->{result} = defined $result ? $result : '-';
+                       $item->{done} = defined $done ? $done : '-';
+                       if ($item->{result} ne '-' and $item->{done} ne '-') {
+                               $item->{done} += $item->{result};
+                       }
 
                        undef $result;
                        if (-f "$item->{dir}/report.log") {
@@ -156,7 +165,7 @@ foreach my $s (keys %list) {
 foreach my $c (sort keys %components) {
        my $cmd;
 
-       for my $s ('install', 'upgrade') {
+       for my $s ('install', 'upgrade', 'minor-upgrade') {
                if (exists $list{$s}) {
                        for my $p (keys %{$list{$s}{$c}}) {
                                $item = $list{$s}{$c}{$p};
@@ -167,7 +176,7 @@ foreach my $c (sort keys %components) {
                        }
                }
        }
-       `cat /tmp/report-$c-install.twiki.part /tmp/report-$c-upgrade.twiki.part > /tmp/report-$c.twiki 2>/dev/null`;
+       `cat /tmp/report-$c-install.twiki.part /tmp/report-$c-upgrade.twiki.part /tmp/report-$c-minor-upgrade.twiki.part > /tmp/report-$c.twiki 2>/dev/null`;
        `rm -f /tmp/report-$c-*.twiki.part`;
 }
 
@@ -232,7 +241,7 @@ if (exists $list{install}) {
 }
 
 if (exists $list{upgrade}) {
-       print "<a name=\"upgrade\"/><h1>Upgrade</h1>\n";
+       print "<a name=\"upgrade\"/><h1>Upgrade from EMI-1 (major)</h1>\n";
        table($list{upgrade});
        print "\n";
        if (-f 'upgrade.html.in') {
@@ -240,6 +249,15 @@ if (exists $list{upgrade}) {
        }
 }
 
+if (exists $list{'minor-upgrade'}) {
+       print "<a name=\"minor-upgrade\"/><h1>Upgrade from EMI-2 (minor)</h1>\n";
+       table($list{'minor-upgrade'});
+       print "\n";
+       if (-f 'minor-upgrade.html.in') {
+               system 'cat minor-upgrade.html.in';
+       }
+}
+
 if (exists $list{build}) {
        print "<a name=\"build\"/><h1>Local build</h1>\n";
        table($list{build});