Changeset 1605


Ignore:
Timestamp:
08/06/09 11:41:41 (16 years ago)
Author:
Mathieu Morlighem
Message:

improved report (oh ye oh ye oh ye)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/report.sh

    r1588 r1605  
    77cat nightly.log | grep 'package: cielo_serial'  | grep -v "not supported yet" > cielo_serial.log
    88cat nightly.log | grep 'package: cielo_parallel'| grep -v "not supported yet" > cielo_parallel.log
    9 cat nightly.log | grep NIGHTLYRUNTERMINATEDCORRECTLY > check.log
    10 cat nightly.log | grep ERROR | grep -v "PETSC ERROR" > errors.log
    11 cat nightly.log | grep SUCCESS > success.log
    12 cat errors.log success.log > tests.log
     9cat nightly.log | grep 'NIGHTLYRUNTERMINATEDCORRECTLY'                        > check.log
     10cat nightly.log | grep 'ERROR'                  | grep -v "PETSC ERROR"      > errors.log
     11cat nightly.log | grep 'SUCCESS'                                              > success.log
     12cat errors.log success.log                                                    > tests.log
    1313
    1414#create some variables
     
    2626fi
    2727
     28#style
     29H1_STYLE='width="800px" cellpadding="20"'
     30H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"'
     31
     32H2_STYLE='width="840px" cellpadding="20"'
     33H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"'
     34
     35TABLE_STYLE='width="820px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"'
     36TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14; font-weight: normal;" align="left"'
     37
     38BODY_STYLE='width="820px"'
     39BODY_FONT="style=\"color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;\""
     40
     41NOTEST_STYLE='width="650px"'
     42NOTEST_FONT='style="color:#FF0000; font-family:Arial, Verdana, Tahoma; font-size:14px;" align="left"'
     43
     44FOOTER_STYLE='width="800px"  cellpadding="10"'
     45FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"'
     46
    2847#build report.html
    2948
    30 #first: header
    31 cat << END > header.html
    32 <style type="text/css">
    33         <!--
    34         .issmbody {
    35                 margin: auto;
    36                 width:800px;
    37                 background: none;
    38                 color: #404040;
    39                 font-family: Arial, Verdana, Tahoma;
    40                 font-size: 14px;
    41                 font-weight: normal;
    42                 text-align: left;
    43                 }
     49#first: summary
     50cat << END > summary.html
     51<div align="center">
     52<table $H1_STYLE><tr><td $H1_FONT>ISSM Nightly run report</td></tr></table>
    4453
    45         .issmh1 {
    46                 margin:2em auto;
    47                 width:800px;
    48                 background: none;
    49                 color: #6495ed;
    50                 font-family: Arial, Verdana, Tahoma;
    51                 font-size: 35px;
    52                 font-weight: bold;
    53                 text-align: center;
    54                 }
    55 
    56         .issmh2 {
    57                 margin:1.5em auto 1em auto;
    58                 width:800px;
    59                 background: transparent;
    60                 color: #6495ed;
    61                 font-family: Arial, Verdana, Tahoma;
    62                 font-weight: bold;
    63                 font-size: 28px;
    64                 text-align: left;
    65                 }
    66 
    67         .issmfooter {
    68                 margin:auto;
    69                 width:800px;
    70                 background: none;
    71                 color: #404040;
    72                 font-family: Arial, Verdana, Tahoma;
    73                 font-size: 12px;
    74                 font-weight: normal;
    75                 text-align: center;
    76                 }
    77 
    78         .issmcomment {
    79                 padding:4px;
    80                 margin:0 auto;
    81                 width:800px;
    82                 border:1px dashed #000000;
    83                 text-align: left;
    84                 font-family: Arial, Verdana, Tahoma;
    85                 font-size: 14px;
    86                 color: #404040;
    87                 background-color:#ffffdd}
    88         -->
    89 </style>
    90 <div class="issmh1">ISSM Nightly run report</div>
    91 <br>
    92 END
    93 
    94 #then: summary
    95 cat << END > summary.html
    96 <div class="issmcomment">
    97 date: $TODAY<br>
    98 host: $HOST_NAME<br>
    99 OS:   $OS<br>
    100 release: $ISSM_RELEASE<br>
    101 total elapsed time: $ELAPSED_TOTAL<br>
    102 installation elapsed time: $ELAPSED_INSTAL<br>
    103 runs elapsed time: $ELAPSED_RUN<br>
    104 <br>
    105 status: $(if [ $(echo $IS_INSTALL) = 0 ];
     54<table $TABLE_STYLE>
     55<tr>
     56<td $TABLE_FONT>host: $HOST_NAME</td>
     57<td $TABLE_FONT>date: $TODAY</td>
     58</tr>
     59<tr>
     60<td $TABLE_FONT>OS: $OS</td>
     61<td $TABLE_FONT>total elapsed time: $ELAPSED_TOTAL</td>
     62</tr>
     63<tr>
     64<td $TABLE_FONT>release: $ISSM_RELEASE</td>
     65<td $TABLE_FONT>installation elapsed time: $ELAPSED_INSTAL</td>
     66</tr>
     67<tr>
     68$(#print status
     69if [ $(echo $IS_INSTALL) = 0 ];
    10670then
    10771        #installation failed, end of report
    108         echo "<span style=\"color:#FF0000\">installation failed</span></div>"
     72        echo "<td $TABLE_FONT>status: <span style=\"color:#FF0000\">installation failed</span></td>"
     73        echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>"
     74        echo "</tr>"
     75        echo "</table>"
    10976        rm check.log errors.log success.log tests.log
    11077else
     78        #installation successful. Did we go to the end?
     79
    11180        if [ $(echo $IS_END) = 0 ];
    11281        then
    113                 echo "<span style=\"color:#FF0000\">stopped before the end</span>"
     82                echo "<td $TABLE_FONT>status: <span style=\"color:#FFA500\">stopped before the end</span></td>"
    11483        else
    115                 echo "all test desks have been run"
     84                echo "<td $TABLE_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td>"
    11685        fi
    117         echo "<br>"
    118         echo "number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)<br>"
    119         echo "number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';rm success.log tests.log)</div>"
    120         echo "<br>"
    121         echo "<hr width=\"900px\">"
     86        echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>"
     87        echo "</tr>"
     88        echo "<tr>"
     89        echo "<td $TABLE_FONT>number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm errors.log)</td>"
     90        echo "<td $TABLE_FONT>  </td>"
     91        echo "</tr>"
     92        echo "<tr>"
     93        echo "<td $TABLE_FONT>number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';  rm success.log tests.log)</td>"
     94        echo "<td $TABLE_FONT>  </td>"
     95        echo "</tr>"
     96        echo "</table>"
     97
     98        #draw a line and clean up
     99        echo "<br><hr width=\"900px\">"
    122100        rm check.log
    123101fi)
    124102END
     103
    125104
    126105#report content
     
    131110
    132111        #enter title
    133         if [ $package == "macayeal" ]; then
    134                 echo "<div class=\"issmh2\">MacAyeal package</div>"
     112        if [ $package == "macayeal" ];
     113        then
     114                echo "<table $H2_STYLE><tr><td $H2_FONT>Macayeal package</td></tr></table>"
    135115        fi
    136         if [ $package == "ice" ]; then
    137                 echo "<div class=\"issmh2\">Ice package</div>"
     116        if [ $package == "ice" ];
     117        then
     118                echo "<table $H2_STYLE><tr><td $H2_FONT>Ice package</td></tr></table>"
    138119        fi
    139         if [ $package == "cielo_serial" ]; then
    140                 echo "<div class=\"issmh2\">Cielo Serial package</div>"
     120        if [ $package == "cielo_serial" ];
     121        then
     122                echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo serial package</td></tr></table>"
    141123        fi
    142         if [ $package == "cielo_parallel" ]; then
    143                 echo "<div class=\"issmh2\">Cielo Parallel package</div>"
     124        if [ $package == "cielo_parallel" ];
     125        then
     126                echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo parallel package</td></tr></table>"
    144127        fi
    145 
    146         #Print division
    147         echo "<div class=\"issmbody\">"
    148128
    149129        #check that at least one Test exists
     
    151131
    152132                #No Test: use a table to fix entourage bug.
    153                 echo "<table width=\"20%\" style=\"color:#FF0000; font-size:14px;\"><tr><td align=\"center\">No test found.</td></tr></table>"
     133                echo "<table $NOTEST_STYLE><tr><td $NOTEST_FONT>No test found.</td></tr></table>"
    154134
    155135        else
    156136
    157                 echo "<table cellspacing=\"-1\" width=\"100%\" style=\"font-family: Arial, Verdana, Tahoma; color: #404040;\">"
    158                 echo "<tr> <th style=\"font-size:14px;\">Result</th> <th style=\"font-size:14px;\">Tolerance</th> <th style=\"font-size:14px;\">Test</th>  <th style=\"font-size:14px;\">Solution</th> <th style=\"font-size:14px;\">Field</th> </tr>"
     137                echo "<table $BODY_STYLE cellspacing=\"-1\">"
     138                echo "<tr> <th $BODY_FONT>Result</th> <th $BODY_FONT>Tolerance</th> <th $BODY_FONT>Test</th>  <th $BODY_FONT>Solution</th> <th $BODY_FONT>Field</th> </tr>"
    159139
    160140                # go through the lines of $package.log
     
    173153                                color="bgcolor=#ffdddd";
    174154                        fi
     155                        FONT=$(echo "$BODY_FONT $color")
    175156
    176157                        #build html corresponding line
    177                         cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk '/line'$COUNTER'o/ {printf("<td '$color' style=\"font-size:14px;\">%s</td><td '$color' style=\"font-size:14px;\"> %s%s%s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td>",$2,$4,$5,$6,$8,$10,$14);}';
     158                        cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk -v FONT="$FONT" '
     159                        /line'$COUNTER'o/ { printf("<td %s>%s</td><td %s> %s%s%s</td><td %s> %s</td><td %s> %s</td><td %s> %s</td>",FONT,$2,FONT,$4,$5,$6,FONT,$8,FONT,$10,FONT,$14);}
     160                        ';
    178161                        echo "</tr>"
    179162                done
     
    182165        fi
    183166
    184         #Print end division and remove log file
    185         echo "</div>"
     167        #remove log file
    186168        rm $package.log
    187169
     
    198180cat << END > footer.html
    199181<br>
    200 <div class="issmfooter"><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</div>
     182<table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table>
     183</div>
    201184END
    202185
     
    204187if [ $(echo $IS_INSTALL) = 1 ];
    205188then
    206         cat header.html summary.html content.html footer.html > report.html
    207         rm  header.html summary.html content.html footer.html
     189        cat summary.html content.html footer.html > report.html
     190        rm  summary.html content.html footer.html
    208191else
    209         cat header.html summary.html footer.html > report.html
    210         rm  header.html summary.html footer.html
     192        cat summary.html footer.html > report.html
     193        rm  summary.html footer.html
    211194fi
Note: See TracChangeset for help on using the changeset viewer.