Use report.html instead f report.twiki, create a symlink if needed.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 13 Nov 2013 09:50:48 +0000 (10:50 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 13 Nov 2013 09:50:48 +0000 (10:50 +0100)
dashboard.pl
matrixgen.pl
template.footer.html [new file with mode: 0644]
template.header.html [new file with mode: 0644]

index a0e25be..80a0e9f 100755 (executable)
@@ -67,20 +67,20 @@ foreach my $s (keys %list) {
 
 #printf STDERR "$item->{component}, $item->{platform}\n";
                        undef $result;
-                       if (-f "$item->{dir}/report.twiki") {
+                       if (-f "$item->{dir}/report.html") {
                                my ($section, $err, $yaim_used, $yaim_finished, $missing_deps);
-                               `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'TESTS END HERE' $item->{dir}/report.html >/dev/null 2>&1`;
                                $section=$?;
-                               `grep -- 'Installed YAIM versions' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'Installed YAIM versions' $item->{dir}/report.html >/dev/null 2>&1`;
                                $yaim_used=$?;
-                               `grep -- 'YAIM terminated succesfully' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'YAIM terminated succesfully' $item->{dir}/report.html >/dev/null 2>&1`;
                                $yaim_finished=$?;
-                               $missing_deps=`grep -- 'Missing Dependency:' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
-                               `grep -- 'ERROR:' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               $missing_deps=`grep -- 'Missing Dependency:' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`;
+                               `grep -- 'ERROR:' $item->{dir}/report.html >/dev/null 2>&1`;
                                $err=$?;
 printf STDERR "  sec: $section, err: $err, missing_deps: $missing_deps\n";
                                if ($section == 0 && $missing_deps == 0 && ($yaim_used != 0 || $yaim_finished == 0)) {
-                                       $result=`grep -- '-TEST FAILED-' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
+                                       $result=`grep -- '-TEST FAILED-' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`;
                                        chomp $result;
                                } else {
                                        if ($missing_deps != 0 ) { $result = "$missing_deps missing deps"; }
@@ -111,28 +111,6 @@ print STDERR "$item->{dir}: $item->{result}, $item->{result2}\n";
 }
 
 
-# ==== glue reports ====
-if (0) {
-foreach my $c (sort keys %components) {
-       my $cmd;
-
-       for my $s ('install', 'upgrade') {
-               if (exists $list{$s}) {
-                       for my $p (keys %{$list{$s}{$c}}) {
-                               $item = $list{$s}{$c}{$p};
-                               if (exists $item->{result} and $item->{result} eq "0") {
-                                       $cmd = "cat $item->{dir}/report.twiki >> /tmp/report-$c-$s.twiki.part";
-                                       `$cmd`;
-                               }
-                       }
-               }
-       }
-       `cat /tmp/report-$c-install.twiki.part /tmp/report-$c-upgrade.twiki.part > /tmp/report-$c.twiki 2>/dev/null`;
-       `rm -f /tmp/report-$c-*.twiki.part`;
-}
-}
-
-
 # ==== matrix ====
 my %fancy = ("lb", "L&amp;B",
          "px", "PX",
index ba983bd..779e858 100755 (executable)
@@ -116,27 +116,36 @@ foreach my $s (keys %list) {
 #printf STDERR "$item->{component}, $item->{platform}\n";
                        undef $result;
                        undef $done;
-                       if (-f "$item->{dir}/report.twiki" or -f "$item->{dir}/report.twiki.bz2") {
+                       if (-f "$item->{dir}/report.twiki" or -f "$item->{dir}/report.twiki.bz2" or -f "$item->{dir}/report.html" or -f "$item->{dir}/report.html.bz2") {
                                my ($section, $err, $yaim_used, $yaim_finished);
                                if (-f "$item->{dir}/report.twiki.bz2") {
                                # we have an older report to use - unpack and touch it
                                        `bunzip2 $item->{dir}/report.twiki.bz2`;
                                        `touch $item->{dir}/report.twiki`;
+                                       `ln -sf report.twiki $item->{dir}/report.html`;
                                }
-                               `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               if (-f "$item->{dir}/report.html.bz2") {
+                               # we have an older report to use - unpack and touch it
+                                       `bunzip2 $item->{dir}/report.html.bz2`;
+                                       `touch $item->{dir}/report.html`;
+                               }
+                               if (-f "$item->{dir}/report.twiki" && ! -f "$item->{dir}/report.html") {
+                                       `ln -sf report.twiki $item->{dir}/report.html`;
+                               }
+                               `grep -- 'TESTS END HERE' $item->{dir}/report.html >/dev/null 2>&1`;
                                $section=$?;
-                               `grep -- 'Installed YAIM versions' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'Installed YAIM versions' $item->{dir}/report.html >/dev/null 2>&1`;
                                $yaim_used=$?;
-                               `grep -- 'YAIM terminated succesfully' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'YAIM terminated succesfully' $item->{dir}/report.html >/dev/null 2>&1`;
                                $yaim_finished=$?;
-                               `grep -- 'ERROR:' $item->{dir}/report.twiki >/dev/null 2>&1`;
+                               `grep -- 'ERROR:' $item->{dir}/report.html >/dev/null 2>&1`;
                                $err=$?;
 #printf STDERR "  sec: $section, err: $err\n";
                                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'`;
+                                       $result=`grep -- '-TEST FAILED-' $item->{dir}/report.html 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'`;
-                                       $skipped=`grep -- '<font color="orange">skipped</font>' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
+                                       $done=`grep -- '<font color="green">done</font>' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`;
+                                       $skipped=`grep -- '<font color="orange">skipped</font>' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`;
                                        chomp $done;
                                        chomp $skipped;
                                } else {
@@ -181,10 +190,6 @@ foreach my $c (sort keys %components) {
                        for my $p (sort keys %{$list{$s}{$c}}) {
                                $item = $list{$s}{$c}{$p};
                                if (exists $item->{result} and $item->{result} eq "0") {
-                                       if (-f "$item->{dir}/report.twiki") {
-                                               $cmd = "cat $item->{dir}/report.twiki >> /tmp/report-$c-$s.part";
-                                               `$cmd`;
-                                       }
                                        if (-f "$item->{dir}/report.html") {
                                                $cmd = "cat $item->{dir}/report.html >> /tmp/report-$c-$s.part";
                                                `$cmd`;
@@ -193,7 +198,9 @@ foreach my $c (sort keys %components) {
                        }
                }
        }
-       `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part > /tmp/report-$c.html 2>/dev/null`;
+       `cat ../template.header.html | sed 's/\@TITLE\@/$c/' > /tmp/report-$c.html`;
+       `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part >> /tmp/report-$c.html 2>/dev/null`;
+       `cat ../template.footer.html >> /tmp/report-$c.html`;
        `rm -f /tmp/report-$c-*.part`;
 }
 
diff --git a/template.footer.html b/template.footer.html
new file mode 100644 (file)
index 0000000..0180684
--- /dev/null
@@ -0,0 +1,4 @@
+
+</body>
+
+</html>
diff --git a/template.header.html b/template.header.html
new file mode 100644 (file)
index 0000000..e41121e
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+  <title>@TITLE@</title>
+</head>
+
+<body>
+