Debian Codegraph @

tools/testing/reporting/scripts/mkDerbyTestIndex_all

raw
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 # Here we show all:
54 REVISIONS=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#"`
55 PREVUPDATEREV=`gawk '{ print $1 }' ${REVISIONSFILE} | grep -v "^#" | head -2 | tail -1`
56
57 # CHANGE HERE TO USE A DIFFERENT FILE:
58 DTI="${DERBYDIR}/testing/${PRESENTATION}/index_all.html"
59 DTIPUB="${PUBLISHDIR}/${PRESENTATION}/index_all.html"
60
61
62 echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" > ${DTI}
63 chmod go+r ${DTI}
64 echo "<html> <head>" >> ${DTI}
65 echo "</head>" >> ${DTI}
66
67 echo "<body>" >> ${DTI}
68
69
70 if [ "$1" != "details" ]
71 then
72
73 echo "<table style=\"text-align: left; width: 100%;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" >> ${DTI}
74 echo " <tbody>" >> ${DTI}
75 echo " <tr>" >> ${DTI}
76 echo " <td style=\"vertical-align: bottom;\"><font size=\"+1\"><b>" >> ${DTI}
77 echo " <a href=\"http://db.apache.org/derby\" target=\"_top\">Apache Derby" >> ${DTI}
78 echo " </a></b></font> is an open source, 100% Java SQL Database." >> ${DTI}
79 echo " </td>" >> ${DTI}
80 # echo " <td style=\"vertical-align: top; text-align: right;\"><i>Web space sponsored by</i>" >> ${DTI}
81 # echo " <a href="http://www.multinet.no/">" >> ${DTI}
82 # echo " <img alt=\"MultiNet AS\" style=\"border: 0px solid ; width: 150px; height: 27px;\"" >> ${DTI}
83 # echo " src=\"http://www.multinet.no/gfx/multilogo.jpg\">" >> ${DTI}
84 # echo " </a>" >> ${DTI}
85 # echo " </td>" >> ${DTI}
86 echo " </tr>" >> ${DTI}
87 echo " </tbody>" >> ${DTI}
88 echo "</table>" >> ${DTI}
89
90 echo "<HR>" >> ${DTI}
91 fi
92
93 TDB="TD style=\"vertical-align: bottom;\""
94 TDT="TD style=\"vertical-align: top;\""
95
96 DURHD="<$TDB></TD>"
97 if [ "${TINDER}" != "" ] || [ "${LARGEDATA}" != "" ]
98 then # Show duration %
99 SHOWDURSUITE="Derbyall"
100 if [ "${LARGEDATA}" != "" ]
101 then
102 SHOWDURSUITE="LargeData"
103 fi
104 DURHD="<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;${SHOWDURSUITE}<br>&nbsp;&nbsp;&nbsp;&nbsp;duration<br>&nbsp;&nbsp;&nbsp;&nbsp;vs baseline </i></TD>"
105 fi
106 # if [ "${TESTID}" = "TinderBox_Derby" ]
107 # then # Show duration %
108 # DURHD="<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;Derbyall<br>&nbsp;&nbsp;&nbsp;&nbsp;duration<br>&nbsp;&nbsp;&nbsp;&nbsp;vs baseline </i></TD>"
109 # fi
110
111 FOOTPRINTBASEREV=`head -1 ${DERBYDIR}/testing/builds/baseline.size | gawk -F\# '{ print $2 }'`
112 # TS=`cat ${UPDATELOGDIR}/${FOOTPRINTBASEREV}/UpdateTime`
113 TS=`head -2 ${DERBYDIR}/testing/builds/baseline.size | tail -1 | gawk -F\# '{ print $2 }'`
114
115 BGCOLOR="bgcolor=\"${COLOR0}\""
116 echo "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" >> ${DTI}
117 echo "<TR ${BGCOLOR} >" >> ${DTI}
118 echo "<$TDB><i> Revision </i></TD>" >> ${DTI}
119 echo "<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;Date, Time </i></TD>" >> ${DTI}
120 echo "<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;Changes </i></TD>" >> ${DTI}
121 echo "<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;Size of derby.jar<br>&nbsp;&nbsp;&nbsp;&nbsp;</i>[Baseline: ${FOOTPRINTBASEREV}<br>&nbsp;&nbsp;&nbsp;&nbsp;${TS}]</TD>" >> ${DTI}
122 echo "<$TDB><i> &nbsp;&nbsp;&nbsp;&nbsp;Derbyall<br>&nbsp;&nbsp;&nbsp;&nbsp;failures </i></TD>" >> ${DTI}
123 echo "${DURHD}" >> ${DTI}
124 echo "<$TDB><i>&nbsp;&nbsp;&nbsp;&nbsp;Notes </i></TD>" >> ${DTI}
125 echo "</TR>" >> ${DTI}
126
127 SANDBOX=`basename ${DERBYDIR}`
128 no=1
129 for REVISION in ${REVISIONS}
130 do
131 echo -n "${REVISION} "
132 TS=`cat ${UPDATELOGDIR}/${REVISION}/UpdateTime`
133 DT=`echo ${TS} | gawk '{ print $1 }'`
134 TT=`echo ${TS} | gawk '{ print $2 }'`
135 TZ=`echo ${TS} | gawk '{ print $3 }'`
136 TS="${DT} ${TT} ${TZ}"
137 CHGLINK="&nbsp;&nbsp;&nbsp;&nbsp;"
138 if [ -e ${DERBYDIR}/testing/UpdateInfo/${REVISION}.txt ]
139 then
140 CHGLINK="&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"../../UpdateInfo/${REVISION}.txt\">Chgs</A> "
141 fi
142 FOOTPRINT="&nbsp;&nbsp;&nbsp;&nbsp;"
143 if [ -e ${DERBYDIR}/testing/builds/${REVISION}.size ]
144 then
145 SIZE=`grep derby.jar ${DERBYDIR}/testing/builds/${REVISION}.size | gawk '{ print $2" "$3 }'`
146 FOOTPRINT="&nbsp;&nbsp;&nbsp;&nbsp;<A href=\"../../builds/${REVISION}.size\">${SIZE}</A>"
147 fi
148
149 DERBALLFAILS=""
150 DERBALLPRCNT=""
151 # TINDERBOX=`echo ${DERBYDIR} | grep TinderBox_`
152 # if [ "${TESTID}" = "TinderBox_Derby" ]
153 # then
154 DERBALLFAILS="["
155 for PLATFORM in ${PLATFORMS} # TinderBox uses ONE platform..
156 do
157 if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ]
158 then
159 if [ -e ${PLATFORM}/${REVISION}.csv ]
160 then
161 # 2: Number, 3: OK, 4: Failed, 5: Skipped, 6: time
162 RES=`grep "^derbyall " ${PLATFORM}/${REVISION}.csv`
163 if [ "${LARGEDATA}" != "" ]
164 then
165 RES=`grep "^largeData " ${PLATFORM}/${REVISION}.csv`
166 fi
167 FAILED=`echo ${RES} | gawk '{ print $4 }'`
168 if [ "${FAILED}" == "" ]
169 then
170 FAILED="?"
171 fi
172 DERBALLFAILS="${DERBALLFAILS} ${FAILED} "
173 if [ "${TINDER}" != "" ] || [ "${LARGEDATA}" != "" ]
174 then
175 TIME=`grep "^derbyall " ${PLATFORM}/${REVISION}.csv | gawk '{ print $6 }'`
176 if [ "${LARGEDATA}" != "" ]
177 then
178 TIME=`grep "^largeData " ${PLATFORM}/${REVISION}.csv | gawk '{ print $6 }'`
179 fi
180 SECONDS=`${TOOLDIR}/toSeconds ${TIME}`
181 BASESECONDS=`grep "^derbyall " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'`
182 if [ "${LARGEDATA}" != "" ]
183 then
184 BASESECONDS=`grep "^largeData " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'`
185 fi
186 PERCENT=`${TOOLDIR}/calcPercent ${SECONDS} ${BASESECONDS}`
187 DERBALLPRCNT="&nbsp;&nbsp;&nbsp;${PERCENT}% "
188 fi
189 else
190 DERBALLFAILS="${DERBALLFAILS} - "
191 fi
192 fi # visible, showdetails
193 done # PLATFORMS
194 DERBALLFAILS="${DERBALLFAILS}]"
195 # fi # TINDERBOX
196
197 BLDERRLINK=""
198 if [ -e ${DERBYDIR}/testing/UpdateInfo/${REVISION}-buildDetails.txt ]
199 then
200 BLDERRLINK="&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"../../UpdateInfo/${REVISION}-buildDetails.txt\"><font color=\"red\"><b> Build Errors!</b></font></A><br>"
201 fi
202
203 FAILURELINK=""
204 if [ -e ${DERBYDIR}/FailReports/${REVISION}.html ]
205 then
206 FAILURELINK="&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"../../FailReports/${REVISION}.html\">${DERBALLFAILS} </A>"
207 elif [ -e ${DERBYDIR}/FailReports/${REVISION}M.html ]
208 then # When we have Mods. e.g. JDK 1.6 testing with local mods to compatibility script....
209 FAILURELINK="&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"../../FailReports/${REVISION}M.html\">${DERBALLFAILS} </A>"
210 fi
211
212 NOTE=""
213 if [ -e ${DERBYDIR}/testing/Notes/${REVISION}.txt ]
214 then
215 TXT=`cat ${DERBYDIR}/testing/Notes/${REVISION}.txt`
216 NOTE="${TXT}"
217 fi
218
219 echo "<$TDT><a href=\"testSummary-"${REVISION}".html\">"${REVISION}"</a></TD>" >> ${DTI}
220 echo "<$TDT>${TS}</TD>" >> ${DTI}
221 echo "<$TDT>${CHGLINK}</TD>" >> ${DTI}
222 echo "<$TDT>${FOOTPRINT}</TD>" >> ${DTI}
223 echo "<$TDT>${BLDERRLINK}${FAILURELINK}</TD>" >> ${DTI}
224 echo "<$TDT>${DERBALLPRCNT}</TD>" >> ${DTI}
225 echo "<$TDT>${NOTE}</TD>" >> ${DTI}
226 no=`expr $no + 1`
227 echo "<TR>" >> ${DTI}
228 done # REVISIONS
229 echo "</TABLE>" >> ${DTI}
230 echo " [${no}]"
231
232
233 echo "<HR>" >> ${DTI}
234 echo "<div style=\"text-align: right;\">" >> ${DTI}
235 echo "<font size=\"-1\"><i>" >> ${DTI}
236 date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${DTI}
237 echo "</i></font>" >> ${DTI}
238 echo "</div>" >> ${DTI}
239
240 # if [ "${SHOWDETAILS}" != "ShowDetails" ]
241 # then
242 # echo "<i>Web space sponsored by</i> " >> ${DTI}
243 # echo "<a href="http://www.multinet.no/">" >> ${DTI}
244 # echo "<img align=\"top\" alt=\"MultiNet AS\" style=\"border: 0px solid; width: 200px; height: 36px;\" src=\"http://www.multinet.no/gfx/multilogo.jpg\"></a>" >> ${DTI}
245 # fi
246 echo "</body>" >> ${DTI}
247 echo "</html>" >> ${DTI}
248 if [ "${SHOWDETAILS}" != "ShowDetails" ]
249 then
250 SRC="${DTI}"
251 DST="${DTIPUB}"
252 echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}"
253 ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}
254 fi
255