#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to you under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. TOOLDIR="${DERBYDIR}/${BRANCH_DIR}/tools/testing/reporting/scripts" . ${TOOLDIR}/env if [ "$1" = "" ] then echo "Usage: $0 current|previous|revision [details]" exit fi WHICH=$1 SHOWDETAILS="" PRESENTATION="Limited" if [ "$2" = "details" ] then # Show details SHOWDETAILS="ShowDetails" PRESENTATION="Full" fi # We have one catalog per platform if [ ! -e ${TESTLOGDIR} ] then echo "${TESTLOGDIR} does not exist" exit fi cd ${TESTLOGDIR} SUMMARY="${DERBYDIR}/testing/${PRESENTATION}/testSummary-${WHICH}-$$.html" SHOWSUMMARY="${DERBYDIR}/testing/${PRESENTATION}/testSummary-${WHICH}.html" SHOWSUMMARYPUB="${PUBLISHDIR}/${PRESENTATION}/testSummary-${WHICH}.html" mkdir -p ${DERBYDIR}/testing/${PRESENTATION} chmod o+xr ${DERBYDIR}/testing/${PRESENTATION} # Get the list of testsuite we are running: TESTLISTFILE="${DERBYDIR}/testing/showtestlist" SUITES=`gawk '{ print $1 }' ${TESTLISTFILE} | grep -v "^#"` PLATFORMS=`ls` DERBYVERSION=" -" if [ "${WHICH}" = "current" ] then DERBYVERSION=`grep "/classes] " ${DERBYDIR}/BuildLog/currentSysInfo.txt | gawk -F] '{ print $2 }'` if [ "${DERBYVERSION}" == "" ] # extractFromJETrun copies from ..._report.txt. Make this default... then DERBYVERSION=`grep "derby.jar] " ${DERBYDIR}/BuildLog/currentSysInfo.txt | gawk -F] '{ print $2 }'` fi elif [ "${WHICH}" = "previous" ] then REVISIONSFILE="${DERBYDIR}/testing/revisionlist" PREVREV=`grep -v "^#" ${REVISIONSFILE} | head -2 | tail -1 | gawk '{ print $1 }'` DERBYVERSION=`grep "/classes] " ${DERBYDIR}/BuildLog/${PREVREV}/sysinfo.txt | gawk -F] '{ print $2 }'` if [ "${DERBYVERSION}" == "" ] # extractFromJETrun copies from ..._report.txt. Make this default... then DERBYVERSION=`grep "derby.jar] " ${DERBYDIR}/BuildLog/${PREVREV}/sysinfo.txt | gawk -F] '{ print $2 }'` fi else DERBYVERSION=`grep "/classes] " ${DERBYDIR}/BuildLog/${WHICH}/sysinfo.txt | gawk -F] '{ print $2 }'` if [ "${DERBYVERSION}" == "" ] # extractFromJETrun copies from ..._report.txt. Make this default... then DERBYVERSION=`grep "derby.jar] " ${DERBYDIR}/BuildLog/${WHICH}/sysinfo.txt | gawk -F] '{ print $2 }'` fi fi SANDBOX=`basename ${DERBYDIR}` echo "" > ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "${SANDBOX} ${WHICH} ${DERBYVERSION} Apache Derby Open Source Database" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} DBV=`echo "${DERBYVERSION}" | gawk -F\( '{ print $2 }' | gawk -F\) '{ print $1 }'` # Next is added since we now get e.g. 394991:394993M DBV=`echo "${DBV}" | gawk -F: '{ print $1 }'` PUREDBV=`echo ${DBV} | sed -e 's/M//'` FAILDBV=${PUREDBV} HASSEQNO=`echo ${WHICH} | grep "S"` if [ "${WHICH}" = "current" ] # No need for mkJIRArefs.current: We have DBV. then ${TOOLDIR}/mkJIRArefs.current ${SANDBOX} current # May be overkill, doing this too many places now..... elif [ "${WHICH}" = "previous" ] # No need for mkJIRArefs.current: We have DBV. then ${TOOLDIR}/mkJIRArefs.current ${SANDBOX} previous # May be overkill, doing this too many places now..... elif [ "${HASSEQNO}" != "" ] then ${TOOLDIR}/mkJIRArefs ${SANDBOX} ${WHICH} # May be overkill, doing this too many places now..... FAILDBV=${WHICH} PUREDBV=${WHICH} else ${TOOLDIR}/mkJIRArefs ${SANDBOX} ${WHICH} # ${DBV} # May be overkill, doing this too many places now..... FAILDBV=${WHICH} PUREDBV=${WHICH} fi DETAILS="(Failures in ${FAILDBV})" NOTE="" if [ -e ${DERBYDIR}/testing/Notes/${WHICH}.txt ] then TXT=`cat ${DERBYDIR}/testing/Notes/${WHICH}.txt` NOTE="
Note: ${TXT}" fi echo " ${SANDBOX} ${WHICH} ${DETAILS} ${NOTE}" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} # Show Legend in top, leftmost col.: echo "" >> ${SUMMARY} fi echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} # Heading: no=0 for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then BGCOLOR="bgcolor=\"${COLOR0}\"" # expr $no % 2 if [ `expr $no % 2` = 0 ] then BGCOLOR="bgcolor=\"${COLOR1}\"" fi no=`expr $no + 1` #DEBUG echo "$no: $BGCOLOR" #DEBUG echo "PLATFORM: ${PLATFORM}" PLATF=`echo "${PLATFORM}" | sed -e 's/CYGWIN_/CYGWIN /' | gawk -F_ '{ print $1"
"$2 }' | sed -e 's/CYGWIN /CYGWIN_/'` #DEBUG echo "PLATF: ${PLATF}" THNAME="" BUILDPLATFHOST=`grep "^Built on " ${PLATFORM}/${WHICH}.csv | gawk '{ print $3" "$4" "$5" "$6 }'` BP=`echo ${BUILDPLATFHOST} | gawk -F[ '{ print $1 }'` BHNAME="" if [ "${SHOWDETAILS}" = "ShowDetails" ] then TESTHOST=`head -1 ${PLATFORM}/${WHICH}.csv | gawk '{ print $1 }'` THNAME="
${TESTHOST}" BHNAME=`echo ${BUILDPLATFHOST} | gawk -F[ '{ print $2 }' | gawk -F] '{ print $1 }'` BHNAME="
${BHNAME}" fi # DEBUG echo "BHNAME: ${BHNAME}" REVISION=`head -1 ${PLATFORM}/${WHICH}.csv | gawk '{ print $7 }'` # Need to check every time in case we're looking at current or previous :-( TS=`cat ${UPDATELOGDIR}/${REVISION}/UpdateTime` TESTLOG_PLATF_DIR="${TESTLOGDIR}/${PLATFORM}" JAVA="${TESTLOG_PLATF_DIR}/${REVISION}.javainfo" JAVAVENDOR=`head -1 ${JAVA}` JAVAVERSION=`tail -1 ${JAVA}` JAVAINFO="${JAVAVENDOR}
${JAVAVERSION}" SHREV="${REVISION}
${TS}" if [ "${REVISION}" != "${PUREDBV}" ] then SHREV="${REVISION}
${TS}
" fi # DEBUG echo "SHREV: ${SHREV}" echo "" >> ${SUMMARY} fi # externallyVisible || "ShowDetails" done # PLATFORMS echo "" >> ${SUMMARY} if [ "${REVISION}" = "" ] then REVISION="${WHICH}" fi echo "" >> ${SUMMARY} # echo "" >> ${SUMMARY} # DBV=`echo "${DERBYVERSION}" | gawk -F\( '{ print $2 }' | gawk -F\) '{ print $1 }'` ## if [ "${SHOWDETAILS}" = "ShowDetails" ] # FIXME ## then echo "" >> ${SUMMARY} ## else ## echo "" >> ${SUMMARY} ## fi for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then for HEAD in Num OK Fail Skip do # echo -n "" >> ${SUMMARY} echo -n "" >> ${SUMMARY} done fi done # PLATFORMS echo "" >> ${SUMMARY} no=0 NA="NA" for SUITE in ${SUITES} do if [ "${SUITE}" = "exit" ] then echo "Exit: found ${SUITE}" echo "
" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "Test platform:

" >> ${SUMMARY} echo "Java Vendor:
" >> ${SUMMARY} echo "Java Version:
" >> ${SUMMARY} if [ "${SHOWDETAILS}" = "ShowDetails" ] then echo "Test host:" >> ${SUMMARY} fi echo "
" >> ${SUMMARY} echo "Rev:
Date & Time:
" >> ${SUMMARY} # DBV=`echo "${DERBYVERSION}" | gawk -F\( '{ print $2 }' | gawk -F\) '{ print $1 }'` # If the build failed: if [ -e ${DERBYDIR}/testing/UpdateInfo/${DBV}-buildDetails.txt ] then echo "ERRORS! " >> ${SUMMARY} SRC="${DERBYDIR}/testing/UpdateInfo/${DBV}-buildDetails.txt" DST="${PUBLISHDIR}/UpdateInfo/${DBV}-buildDetails.txt" echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi if [ "${SHOWDETAILS}" != "ShowDetails" ] then # Make sure we transfer the change info from previous rev.: SRC="${DERBYDIR}/testing/UpdateInfo/${PUREDBV}.txt" DST="${PUBLISHDIR}/UpdateInfo/${PUREDBV}.txt" echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi echo "Build platform:" >> ${SUMMARY} if [ "${SHOWDETAILS}" = "ShowDetails" ] then echo "
Build host:
${PLATF}
${JAVAINFO}${THNAME}
${SHREV}
${BP}${BHNAME}
Changes(->${REVISION}) Changes(->${PUREDBV}) Changes(->${PUREDBV}) ${HEAD} ${HEAD}
" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "" >> ${SUMMARY} date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${SUMMARY} echo "" >> ${SUMMARY} echo "
" >> ${SUMMARY} cp -f ${SUMMARY} ${SHOWSUMMARY} chmod go+r ${SHOWSUMMARY} rm -f ${SUMMARY} if [ "${SHOWDETAILS}" != "ShowDetails" ] then SRC="${SHOWSUMMARY}" DST="${SHOWSUMMARYPUB}" echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi exit fi echo "${SUITE}" BGCOLOR="bgcolor=\"${COLOR0}\"" # expr $no % 2 if [ `expr $no % 2` = 0 ] then BGCOLOR="bgcolor=\"${COLOR1}\"" fi no=`expr $no + 1` #DEBUG echo "$no: $BGCOLOR" echo "${SUITE}" >> ${SUMMARY} for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then echo " ${PLATFORM}" # 2: Number, 3: OK, 4: Failed, 5: Skipped RES=`grep "^${SUITE} " ${PLATFORM}/${WHICH}.csv` if [ "${RES}" = "" ] then RES=""$NA""$NA""$NA""$NA"" else NUMBER=`echo ${RES} | gawk '{ print $2 }'` OK=`echo ${RES} | gawk '{ print $3 }'` FAILED=`echo ${RES} | gawk '{ print $4 }'` SKIPPED=`echo ${RES} | gawk '{ print $5 }'` CFB="" CSB="" if [ "${FAILED}" != "0" ] then REVISION=`head -1 ${PLATFORM}/${WHICH}.csv | gawk '{ print $7 }'` FAILFILE="${PLATFORM}/${REVISION}-${SUITE}_diff.txt" FAILED="${FAILED}" CFB="bgcolor=\"red\"" if [ "${SHOWDETAILS}" != "ShowDetails" ] then SRC="${DERBYDIR}/testing/testlog/${FAILFILE}" DST="${PUBLISHDIR}/testlog/${FAILFILE}" chmod go+r ${SRC} echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi fi if [ "${SKIPPED}" != "0" ] then REVISION=`head -1 ${PLATFORM}/${WHICH}.csv | gawk '{ print $7 }'` SKIPFILE="${PLATFORM}/${REVISION}-${SUITE}_skipped.txt" SKIPPED="${SKIPPED}" # CSB="bgcolor=\"yellow\"" CSB="bgcolor=\"#FFFFA0\"" if [ "${SHOWDETAILS}" != "ShowDetails" ] then SRC="${DERBYDIR}/testing/testlog/${SKIPFILE}" DST="${PUBLISHDIR}/testlog/${SKIPFILE}" chmod go+r ${SRC} echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi fi CNB="" if [ "${NUMBER}" == "0" ] then CNB="bgcolor=\"yellow\"" fi RES="${NUMBER}${OK}${FAILED}${SKIPPED}" fi #DEBUG echo "${RES}" echo -n "${RES}" >> ${SUMMARY} fi done # PLATFORMS echo "" >> ${SUMMARY} # if [ "${SHOWDETAILS}" = "ShowDetails" ] # then echo "" >> ${SUMMARY} echo " Duration:" >> ${SUMMARY} for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then #DEBUG echo " ${PLATFORM}" TIME=`grep "^${SUITE} " ${PLATFORM}/${WHICH}.csv | gawk '{ print $6 }'` # echo "${TIME}" if [ "${TIME}" = "" ] then RES=""$NA"" STARTED=`head -1 ${PLATFORM}/suiteStart.txt` if [ "${SHOWDETAILS}" = "ShowDetails" ] then if [ "${STARTED}" != "" ] then RES="Start: ${STARTED}" RES="${RES}" fi fi echo -n "${RES}" >> ${SUMMARY} else SECONDS=`${TOOLDIR}/toSeconds ${TIME}` # echo ${SECONDS} BASESECONDS=`grep "^${SUITE} " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'` # echo ${BASESECONDS} PERCENT=`${TOOLDIR}/calcPercent ${SECONDS} ${BASESECONDS}` # echo ${PERCENT} # RES=""${TIME} ${PERCENT}"" # echo ${RES} if [ "${SHOWDETAILS}" = "ShowDetails" ] then echo -n "" >> ${SUMMARY} echo -n " ${TIME} " >> ${SUMMARY} echo -n "" >> ${SUMMARY} echo -n "" >> ${SUMMARY} echo -n " ${PERCENT}% " >> ${SUMMARY} echo -n "" >> ${SUMMARY} else echo -n "" >> ${SUMMARY} echo -n " ${PERCENT}% " >> ${SUMMARY} echo -n "" >> ${SUMMARY} fi # echo -n "${RES}" >> ${SUMMARY} fi fi done # PLATFORMS echo "" >> ${SUMMARY} # fi # SHOWDETAILS done # SUITE in ${SUITES} # Show baseline info for each platform: echo "" >> ${SUMMARY} echo " Baseline for
duration is rev.:
" >> ${SUMMARY} no=0 for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then BGCOLOR="bgcolor=\"${COLOR0}\"" # expr $no % 2 if [ `expr $no % 2` = 0 ] then BGCOLOR="bgcolor=\"${COLOR1}\"" fi no=`expr $no + 1` BASELINE=`head -1 ${PLATFORM}/baseline.csv | gawk '{ print $2 }'` TS=`cat ${UPDATELOGDIR}/${BASELINE}/UpdateTime` PLATF=`echo "${PLATFORM}" | sed -e 's/CYGWIN_/CYGWIN /' | gawk -F_ '{ print $1"
"$2 }' | sed -e 's/CYGWIN /CYGWIN_/'` echo "${BASELINE}
${TS}
(${PLATF})
" >> ${SUMMARY} fi done # PLATFORMS echo "" >> ${SUMMARY} if [ "${SHOWDETAILS}" == "ShowDetails" ] # Internal pages then echo "" >> ${SUMMARY} # Show link to revision.zip file on internal pages: echo " Zipped
'Java user dir':
" >> ${SUMMARY} no=0 for PLATFORM in ${PLATFORMS} do BGCOLOR="bgcolor=\"${COLOR0}\"" # expr $no % 2 if [ `expr $no % 2` = 0 ] then BGCOLOR="bgcolor=\"${COLOR1}\"" fi no=`expr $no + 1` REVISION=`head -1 ${PLATFORM}/${WHICH}.csv | gawk '{ print $7 }'` ZIPFILE="${PLATFORM}/${REVISION}.zip" ZIPPED="${REVISION}.zip" echo "${ZIPPED}" >> ${SUMMARY} done # PLATFORMS echo "" >> ${SUMMARY} fi echo "" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "" >> ${SUMMARY} date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${SUMMARY} echo "" >> ${SUMMARY} echo "
" >> ${SUMMARY} echo "" >> ${SUMMARY} echo "" >> ${SUMMARY} cp -f ${SUMMARY} ${SHOWSUMMARY} chmod go+r ${SHOWSUMMARY} rm -f ${SUMMARY} if [ "${SHOWDETAILS}" != "ShowDetails" ] then SRC="${SHOWSUMMARY}" DST="${SHOWSUMMARYPUB}" echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi # Transfer -system info for PLATFORM in ${PLATFORMS} do SRC="${DERBYDIR}/testing/testlog/${PLATFORM}/${REVISION}-system" EXTVIS="${DERBYDIR}/testing/testlog/${PLATFORM}/externallyVisible" if [ -e ${EXTVIS} ] && [ "${SHOWDETAILS}" != "ShowDetails" ] && [ -e ${SRC} ] then DST="${PUBLISHDIR}/testlog/${PLATFORM}/${REVISION}-system" chmod go+r ${SRC} echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ### ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi done # PLATFORMS