| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 |
# contributor license agreements. See the NOTICE file distributed with |
| 5 |
# this work for additional information regarding copyright ownership. |
| 6 |
# The ASF licenses this file to you under the Apache License, Version 2.0 |
| 7 |
# (the "License"); you may not use this file except in compliance with |
| 8 |
# the License. You may obtain a copy of the License at |
| 9 |
# |
| 10 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
# |
| 12 |
# Unless required by applicable law or agreed to in writing, software |
| 13 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
# See the License for the specific language governing permissions and |
| 16 |
# limitations under the License. |
| 17 |
|
| 18 |
TOOLDIR="${DERBYDIR}/${BRANCH_DIR}/tools/testing/reporting/scripts" |
| 19 |
. ${TOOLDIR}/env |
| 20 |
|
| 21 |
SHOWDETAILS="" |
| 22 |
PRESENTATION="Limited" |
| 23 |
if [ "$1" = "details" ] |
| 24 |
then |
| 25 |
# Show details |
| 26 |
SHOWDETAILS="ShowDetails" |
| 27 |
PRESENTATION="Full" |
| 28 |
fi |
| 29 |
|
| 30 |
# We have one catalog per platform |
| 31 |
if [ ! -e ${TESTLOGDIR} ] |
| 32 |
then |
| 33 |
echo "${TESTLOGDIR} does not exist" |
| 34 |
exit |
| 35 |
fi |
| 36 |
|
| 37 |
# Get the list of testsuite we are running: |
| 38 |
TESTLISTFILE="${DERBYDIR}/testing/showtestlist" |
| 39 |
SUITES=`gawk '{ print $1 }' ${TESTLISTFILE} | grep -v "^#"` |
| 40 |
|
| 41 |
# Get the set of platforms |
| 42 |
cd ${TESTLOGDIR} |
| 43 |
PLATFORMS=`ls` |
| 44 |
|
| 45 |
TESTID=`echo ${DERBYDIR} | gawk -F/ '{ print $NF }'` |
| 46 |
# Derby | TinderBox_Derby | XDerbyX | myDerbySandbox | jvm1.5 .... |
| 47 |
TINDER=`echo "${TESTID}" | grep TinderBox` # Contains TinderBox |
| 48 |
LARGEDATA=`echo "${TESTID}" | grep LargeData` # Contains LargeData |
| 49 |
|
| 50 |
# Get the list of revisions |
| 51 |
REVISIONSFILE="${DERBYDIR}/testing/revisionlist" |
| 52 |
# head -60 to reduce to approx. last 3 months of daily tests (otherwise last 60 - ..TinderBox) |
| 53 |
# head -16 to reduce to approx. last 2 weeks of daily tests (otherwise last 16 - ..TinderBox) |
| 54 |
NREVS=16 |
| 55 |
if [ "${TINDER}" != "" ] |
| 56 |
then |
| 57 |
NREVS=32 |
| 58 |
fi |
| 59 |
|
| 60 |
# Update summary info for top level sandbox page: |
| 61 |
CUR_REV=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#" | head -1` |
| 62 |
${TOOLDIR}/mkSandBoxSummary ${CUR_REV} "$1" |
| 63 |
# |
| 64 |
|
| 65 |
REVISIONS=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#" | head -${NREVS}` |
| 66 |
# LASTUPDATEREV=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#" | head -1 ` |
| 67 |
PREVUPDATEREV=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#" | head -2 | tail -1` |
| 68 |
# If we use LASTUPDATEREV ~ head -1 svn log may not report the last update.... See below. |
| 69 |
|
| 70 |
# DTI="${DERBYDIR}/testing/testSummary.html" |
| 71 |
DTI="${DERBYDIR}/testing/${PRESENTATION}/index.html" |
| 72 |
DTIPUB="${PUBLISHDIR}/${PRESENTATION}/index.html" |
| 73 |
|
| 74 |
PUBLICREGRESSIONTESTMSG="<P>We provide daily regression test results based on the Apache Derby test suites. The regression tests are executed on several platforms.</P>" |
| 75 |
INTERNALREGRESSIONTESTMSG="<P>We currently run the Derby test suites on a number of platforms available at ${WHOWEAREINTERN}.</P>" |
| 76 |
if [ "${TINDER}" != "" ] |
| 77 |
then |
| 78 |
PUBLICREGRESSIONTESTMSG="<P>\"<em>Tinderbox</em>\" testing is performed when updates to the Derby source code repository is detected. This is done on one single test platform.</P>" |
| 79 |
INTERNALREGRESSIONTESTMSG="${PUBLICREGRESSIONTESTMSG}" |
| 80 |
fi |
| 81 |
|
| 82 |
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" > ${DTI} |
| 83 |
echo "<html> <head>" >> ${DTI} |
| 84 |
chmod go+r ${DTI} |
| 85 |
if [ "$1" = "details" ] |
| 86 |
then |
| 87 |
echo "<title>Derby @ ${WHOWEARE} Regression Test Results [${TESTID}]</title>" >> ${DTI} |
| 88 |
else |
| 89 |
echo "<title>Apache Derby Open Source Database, Regression Test Results [${TESTID}]</title>" >> ${DTI} |
| 90 |
fi |
| 91 |
echo "</head>" >> ${DTI} |
| 92 |
|
| 93 |
echo "<body>" >> ${DTI} |
| 94 |
|
| 95 |
if [ "$1" != "details" ] |
| 96 |
then |
| 97 |
# echo "<br><font size=\"+1\"><b><a href=\"http://db.apache.org/derby\" target=\"_top\">Apache Derby</a></b></font> is an open source, 100% Java SQL Database." >> ${DTI} |
| 98 |
|
| 99 |
|
| 100 |
echo "<table style=\"text-align: left; width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" >> ${DTI} |
| 101 |
echo " <tbody>" >> ${DTI} |
| 102 |
echo " <tr>" >> ${DTI} |
| 103 |
echo " <td style=\"vertical-align: bottom;\"><font size=\"+1\"><b>" >> ${DTI} |
| 104 |
echo " <a href=\"http://db.apache.org/derby\" target=\"_top\">Apache Derby" >> ${DTI} |
| 105 |
echo " </a></b></font> is an open source, 100% Java SQL Database." >> ${DTI} |
| 106 |
echo " </td>" >> ${DTI} |
| 107 |
echo " </tr>" >> ${DTI} |
| 108 |
echo " </tbody>" >> ${DTI} |
| 109 |
echo "</table>" >> ${DTI} |
| 110 |
|
| 111 |
echo "<HR>" >> ${DTI} |
| 112 |
fi |
| 113 |
if [ "$1" = "details" ] |
| 114 |
then |
| 115 |
echo "<h2>Derby @ ${WHOWEARE} Regression Test Results [${TESTID}]" >> ${DTI} |
| 116 |
echo "  " >> ${DTI} |
| 117 |
echo " <font size=-1>[<a href=\"InternalURL\">All ${WHOWEARE} Derby Tests</a>]</font>" >> ${DTI} |
| 118 |
echo "</h2>" >> ${DTI} |
| 119 |
echo "<a href=\"${INTERNHREF}\">" >> ${DTI} |
| 120 |
### UNCOMMENT IF YOU HAVE A LOGO. echo "<img style=\"border: 0px solid\" src=\"${WHOWEARELOGO}\" alt=\"${WHOWEAREALT}\"><br>" >> ${DTI} |
| 121 |
echo "<i>${WHOWEARELONG}</i><p/>" >> ${DTI} |
| 122 |
echo "</a>" >> ${DTI} |
| 123 |
echo "${INTERNALREGRESSIONTESTMSG}" >> ${DTI} |
| 124 |
else |
| 125 |
echo "<h2>Derby Regression Test Results [${TESTID}]" >> ${DTI} |
| 126 |
echo "  " >> ${DTI} |
| 127 |
echo " <font size=-1>[<a href=\"externalURL\">All ${WHOWEARE} Derby Tests</a>]</font>" >> ${DTI} |
| 128 |
echo "</h2>" >> ${DTI} |
| 129 |
echo "<i>${WHOWEARELONG}</i><p/>" >> ${DTI} |
| 130 |
echo "${PUBLICREGRESSIONTESTMSG}" >> ${DTI} |
| 131 |
fi |
| 132 |
echo "<P></P>" >> ${DTI} |
| 133 |
|
| 134 |
echo "<P><a href="testSummary-current.html">Results of the latest testrun</a> started. This will show NA for test suites not yet completed.</P>" >> ${DTI} |
| 135 |
|
| 136 |
echo "<P><a href="testSummary-previous.html">Results of the previous testrun.</a></P>" >> ${DTI} |
| 137 |
|
| 138 |
THISPWD=`pwd` |
| 139 |
cd ${derby_source} |
| 140 |
echo "Latest Derby revision: " >> ${DTI} |
| 141 |
|
| 142 |
svn log -r${PREVUPDATEREV}:HEAD | grep "lines$" | grep "|" | tail -1 | sed -e 's/^r//' | gawk -F\| '{ print $1"["$3"]" }' >> ${DTI} |
| 143 |
echo " per " >> ${DTI} |
| 144 |
cd ${THISPWD} |
| 145 |
date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${DTI} |
| 146 |
|
| 147 |
|
| 148 |
echo "<BR>" >> ${DTI} |
| 149 |
echo "<h3>Tested Revisions</h3>" >> ${DTI} |
| 150 |
|
| 151 |
|
| 152 |
TDB="TD style=\"vertical-align: bottom;\"" |
| 153 |
TDT="TD style=\"vertical-align: top;\"" |
| 154 |
|
| 155 |
DURHD="<$TDB></TD>" |
| 156 |
if [ "${TINDER}" != "" ] || [ "${LARGEDATA}" != "" ] |
| 157 |
then # Show duration % |
| 158 |
SHOWDURSUITE="Derbyall" |
| 159 |
if [ "${LARGEDATA}" != "" ] |
| 160 |
then |
| 161 |
SHOWDURSUITE="LargeData" |
| 162 |
fi |
| 163 |
DURHD="<$TDB><i> ${SHOWDURSUITE}<br> duration<br> vs baseline </i></TD>" |
| 164 |
fi |
| 165 |
|
| 166 |
FOOTPRINTBASEREV=`head -1 ${DERBYDIR}/testing/builds/baseline.size | gawk -F\# '{ print $2 }'` |
| 167 |
# TS=`cat ${UPDATELOGDIR}/${FOOTPRINTBASEREV}/UpdateTime` |
| 168 |
TS=`head -2 ${DERBYDIR}/testing/builds/baseline.size | tail -1| gawk -F\# '{ print $2 }'` |
| 169 |
|
| 170 |
BGCOLOR="bgcolor=\"${COLOR0}\"" |
| 171 |
echo "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" >> ${DTI} |
| 172 |
echo "<TR ${BGCOLOR} >" >> ${DTI} |
| 173 |
echo "<$TDB><i> Revision </i></TD>" >> ${DTI} |
| 174 |
echo "<$TDB><i> Date, Time </i></TD>" >> ${DTI} |
| 175 |
echo "<$TDB><i> Changes </i></TD>" >> ${DTI} |
| 176 |
echo "<$TDB><i> Size of derby.jar<br> </i>[Baseline: ${FOOTPRINTBASEREV}<br> ${TS}]</TD>" >> ${DTI} |
| 177 |
echo "<$TDB><i> Derbyall<br> failures </i></TD>" >> ${DTI} |
| 178 |
echo "${DURHD}" >> ${DTI} |
| 179 |
echo "<$TDB><i> Notes </i></TD>" >> ${DTI} |
| 180 |
echo "</TR>" >> ${DTI} |
| 181 |
|
| 182 |
SANDBOX=`basename ${DERBYDIR}` |
| 183 |
no=1 |
| 184 |
for REVISION in ${REVISIONS} |
| 185 |
do |
| 186 |
echo "<TR>" >> ${DTI} |
| 187 |
TS=`cat ${UPDATELOGDIR}/${REVISION}/UpdateTime` |
| 188 |
DT=`echo ${TS} | gawk '{ print $1 }'` |
| 189 |
TT=`echo ${TS} | gawk '{ print $2 }'` |
| 190 |
TZ=`echo ${TS} | gawk '{ print $3 }'` |
| 191 |
TS="${DT} ${TT} ${TZ}" |
| 192 |
CHGLINK=" " |
| 193 |
if [ -e ${DERBYDIR}/testing/UpdateInfo/${REVISION}.txt ] |
| 194 |
then |
| 195 |
## if [ "$1" != "details" ] # FIXME |
| 196 |
## then |
| 197 |
## CHGLINK=" <A HREF=\"../../../UpdateInfo/${REVISION}.txt\">Chgs</A> " |
| 198 |
## else |
| 199 |
CHGLINK=" <A HREF=\"../../UpdateInfo/${REVISION}.txt\">Chgs</A> " |
| 200 |
## fi |
| 201 |
fi |
| 202 |
FOOTPRINT=" " |
| 203 |
if [ -e ${DERBYDIR}/testing/builds/${REVISION}.size ] |
| 204 |
then |
| 205 |
SIZE=`grep derby.jar ${DERBYDIR}/testing/builds/${REVISION}.size | gawk '{ print $2" "$3 }'` |
| 206 |
# FOOTPRINT=" <A href=\"../../../builds/${REVISION}.size\">${SIZE}</A>" |
| 207 |
FOOTPRINT=" <A href=\"../../builds/${REVISION}.size\">${SIZE}</A>" |
| 208 |
fi |
| 209 |
|
| 210 |
DERBALLFAILS="" |
| 211 |
DERBALLPRCNT="" |
| 212 |
# TINDERBOX=`echo ${DERBYDIR} | grep TinderBox_` |
| 213 |
# if [ "${TINDER}" != "" ] |
| 214 |
# then |
| 215 |
DERBALLFAILS="[" |
| 216 |
for PLATFORM in ${PLATFORMS} # TinderBox uses ONE platform.. |
| 217 |
do |
| 218 |
# echo -n "${PLATFORM} "; pwd |
| 219 |
if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] |
| 220 |
then |
| 221 |
if [ -e ${PLATFORM}/${REVISION}.csv ] |
| 222 |
then |
| 223 |
# 2: Number, 3: OK, 4: Failed, 5: Skipped, 6: time |
| 224 |
RES=`grep "^derbyall " ${PLATFORM}/${REVISION}.csv` |
| 225 |
# DEBUG RES=`grep "^demo " ${PLATFORM}/${REVISION}.csv` |
| 226 |
if [ "${LARGEDATA}" != "" ] |
| 227 |
then |
| 228 |
RES=`grep "^largeData " ${PLATFORM}/${REVISION}.csv` |
| 229 |
fi |
| 230 |
FAILED=`echo ${RES} | gawk '{ print $4 }'` |
| 231 |
if [ "${FAILED}" == "" ] |
| 232 |
then |
| 233 |
FAILED="?" |
| 234 |
fi |
| 235 |
DERBALLFAILS="${DERBALLFAILS} ${FAILED} " |
| 236 |
if [ "${TINDER}" != "" ] || [ "${LARGEDATA}" != "" ] |
| 237 |
then |
| 238 |
TIME=`grep "^derbyall " ${PLATFORM}/${REVISION}.csv | gawk '{ print $6 }'` |
| 239 |
if [ "${LARGEDATA}" != "" ] |
| 240 |
then |
| 241 |
TIME=`grep "^largeData " ${PLATFORM}/${REVISION}.csv | gawk '{ print $6 }'` |
| 242 |
fi |
| 243 |
SECONDS=`${TOOLDIR}/toSeconds ${TIME}` |
| 244 |
BASESECONDS=`grep "^derbyall " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'` |
| 245 |
if [ "${LARGEDATA}" != "" ] |
| 246 |
then |
| 247 |
BASESECONDS=`grep "^largeData " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'` |
| 248 |
fi |
| 249 |
PERCENT=`${TOOLDIR}/calcPercent ${SECONDS} ${BASESECONDS}` |
| 250 |
DERBALLPRCNT=" ${PERCENT}% " |
| 251 |
fi |
| 252 |
else |
| 253 |
DERBALLFAILS="${DERBALLFAILS} - " |
| 254 |
fi |
| 255 |
fi # visible, showdetails |
| 256 |
done # PLATFORMS |
| 257 |
DERBALLFAILS="${DERBALLFAILS}]" |
| 258 |
# fi # TINDERBOX |
| 259 |
###### |
| 260 |
# Above if ... |
| 261 |
# fi could be replaced by |
| 262 |
# DERBALLFAILS=`${TOOLDIR}/platformsFailCount ${REVISION} "${SHOWDETAILS}" ${SUITE}` |
| 263 |
# DERBALLPRCNT=`${TOOLDIR}/platformsDurPrcnt ${REVISION} "${SHOWDETAILS}" ${SUITE}` |
| 264 |
###### |
| 265 |
|
| 266 |
BLDERRLINK="" |
| 267 |
if [ -e ${DERBYDIR}/testing/UpdateInfo/${REVISION}-buildDetails.txt ] |
| 268 |
then |
| 269 |
BLDERRLINK=" <A HREF=\"../../UpdateInfo/${REVISION}-buildDetails.txt\"><font color=\"red\"><b> Build Errors!</b></font></A><br>" |
| 270 |
fi |
| 271 |
|
| 272 |
FAILURELINK="" |
| 273 |
if [ -e ${DERBYDIR}/FailReports/${REVISION}.html ] |
| 274 |
then |
| 275 |
FAILURELINK=" <A HREF=\"../../FailReports/${REVISION}.html\">${DERBALLFAILS} </A>" |
| 276 |
elif [ -e ${DERBYDIR}/FailReports/${REVISION}M.html ] |
| 277 |
then # When we have Mods. e.g. JDK 1.6 testing with local mods to compatibility script.... |
| 278 |
FAILURELINK=" <A HREF=\"../../FailReports/${REVISION}M.html\">${DERBALLFAILS} </A>" |
| 279 |
fi |
| 280 |
|
| 281 |
NOTE="" |
| 282 |
if [ -e ${DERBYDIR}/testing/Notes/${REVISION}.txt ] |
| 283 |
then |
| 284 |
TXT=`cat ${DERBYDIR}/testing/Notes/${REVISION}.txt` |
| 285 |
NOTE="${TXT}" |
| 286 |
fi |
| 287 |
|
| 288 |
echo "<$TDT><a href=\"testSummary-"${REVISION}".html\">"${REVISION}"</a></TD>" >> ${DTI} |
| 289 |
echo "<$TDT>${TS}</TD>" >> ${DTI} |
| 290 |
echo "<$TDT>${CHGLINK}</TD>" >> ${DTI} |
| 291 |
echo "<$TDT>${FOOTPRINT}</TD>" >> ${DTI} |
| 292 |
echo "<$TDT>${BLDERRLINK}${FAILURELINK}</TD>" >> ${DTI} |
| 293 |
echo "<$TDT>${DERBALLPRCNT}</TD>" >> ${DTI} |
| 294 |
echo "<$TDT>${NOTE}</TD>" >> ${DTI} |
| 295 |
no=`expr $no + 1` |
| 296 |
echo "<TR>" >> ${DTI} |
| 297 |
done # REVISIONS |
| 298 |
echo "</TABLE>" >> ${DTI} |
| 299 |
|
| 300 |
########################################## |
| 301 |
# BEGIN SKIP if ...._Release or ...._RC tests or ...._Snapshot tests |
| 302 |
IS_RELEASE=`echo ${DERBYDIR} | grep "_Release/"` |
| 303 |
IS_SNAPSHOT=`echo ${DERBYDIR} | grep "_Snapshot/"` |
| 304 |
IS_RC=`echo ${DERBYDIR} | grep "_RC/"` |
| 305 |
if [ "${IS_RELEASE}" == "" ] && [ "${IS_RC}" == "" ] && [ "${IS_SNAPSHOT}" == "" ] |
| 306 |
then |
| 307 |
|
| 308 |
echo "See full history <a href=\"index_all.html\">here!</a><BR>" >> ${DTI} |
| 309 |
|
| 310 |
|
| 311 |
if [ "${SHOWDETAILS}" = "ShowDetails" ] |
| 312 |
then |
| 313 |
echo "<HR>" >> ${DTI} |
| 314 |
echo "Experimental duration plots: " >> ${DTI} |
| 315 |
echo "<a href=\"plot/plot.html\">all builds</a>, " >> ${DTI} |
| 316 |
echo "<a href=\"plot/plot_last20.html\">last N builds</a>." >> ${DTI} |
| 317 |
fi |
| 318 |
|
| 319 |
fi |
| 320 |
# END SKIP if ....Release or ....Snapshot tests |
| 321 |
########################################## |
| 322 |
|
| 323 |
echo "<HR>" >> ${DTI} |
| 324 |
echo "<div style=\"text-align: right;\">" >> ${DTI} |
| 325 |
echo "<font size=\"-1\"><i>" >> ${DTI} |
| 326 |
date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${DTI} |
| 327 |
echo "</i></font>" >> ${DTI} |
| 328 |
echo "</div>" >> ${DTI} |
| 329 |
|
| 330 |
|
| 331 |
echo "</body>" >> ${DTI} |
| 332 |
echo "</html>" >> ${DTI} |
| 333 |
if [ "${SHOWDETAILS}" != "ShowDetails" ] |
| 334 |
then |
| 335 |
SRC="${DTI}" |
| 336 |
DST="${DTIPUB}" |
| 337 |
echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" |
| 338 |
### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} |
| 339 |
fi |
| 340 |
|