From 5b1f24caccc80a15a0e47a827b9b5fd59778cc83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 2 Jul 2012 22:50:45 +0200 Subject: [PATCH] Support minor upgrades. --- matrixgen.pl | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/matrixgen.pl b/matrixgen.pl index 4ad71d2..04e7918 100755 --- a/matrixgen.pl +++ b/matrixgen.pl @@ -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 -- 'done' $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 "

Upgrade

\n"; + print "

Upgrade from EMI-1 (major)

\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 "

Upgrade from EMI-2 (minor)

\n"; + table($list{'minor-upgrade'}); + print "\n"; + if (-f 'minor-upgrade.html.in') { + system 'cat minor-upgrade.html.in'; + } +} + if (exists $list{build}) { print "

Local build

\n"; table($list{build}); -- 1.8.2.3