#!/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 SHOWDETAILS="" PRESENTATION="Limited" if [ "$1" = "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 # Get the list of testsuite we are running: TESTLISTFILE="${DERBYDIR}/testing/showtestlist" SUITES=`gawk '{ print $1 }' ${TESTLISTFILE} | grep -v "^#"` # Get the set of platforms cd ${TESTLOGDIR} PLATFORMS=`ls` # Get the list of revisions # 12 latest. REVISIONSFILE="${REVISIONLIST}" REVISIONS=`head -12 ${REVISIONSFILE} | gawk '{ print $1 }' | grep -v "^#"` # Main loop for collecting suite status: for SUITE in ${SUITES} do if [ "${SUITE}" = "exit" ] then echo "Exit: found ${SUITE}" exit fi echo "${SUITE}" HISTORY="${DERBYDIR}/testing/${PRESENTATION}/${SUITE}_history.html" mkdir -p ${DERBYDIR}/testing/${PRESENTATION} chmod o+rx ${DERBYDIR}/testing/${PRESENTATION} # Build table header: echo "" > ${HISTORY} echo "" >> ${HISTORY} echo "" >> ${HISTORY} # NB This is the only variation in header.... 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}" PLATF=`echo "${PLATFORM}" | gawk -F_ '{ print $1"
"$2"
"$3 }'` #DEBUG echo "${PLATF}" echo "" >> ${HISTORY} echo "" >> ${HISTORY} echo "" >> ${HISTORY} for PLATFORM in ${PLATFORMS} do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then for HEAD in Num OK Fail Skip do echo -n "" >> ${HISTORY} done fi done # PLATFORMS echo "" >> ${HISTORY} # Done building header. for REVISION in ${REVISIONS} do TS=`cat ${UPDATELOGDIR}/${REVISION}/UpdateTime` echo " ${REVISION}" 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 "" >> ${HISTORY} 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}/${REVISION}.csv` #DEBUG echo "${SUITE}: ${RES}" if [ "${RES}" = "" ] then RES="" 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 # REV=`head -1 ${PLATFORM}/${REVISION}.csv | gawk '{ print $7 }'` FAILED="${FAILED}" CFB="bgcolor=\"red\"" fi if [ "${SKIPPED}" != "0" ] then # CSB="bgcolor=\"yellow\"" CSB="bgcolor=\"#FFFFA0\"" fi RES="" fi # DEBUG echo "${RES}" echo -n "${RES}" >> ${HISTORY} fi done # PLATFORMS Number, OK, Failed, Skipped echo "" >> ${HISTORY} # if [ "${SHOWDETAILS}" = "ShowDetails" ] # then echo "" >> ${HISTORY} echo "" >> ${HISTORY} for PLATFORM in ${PLATFORMS} # Duration do if [ -e ${PLATFORM}/externallyVisible ] || [ "${SHOWDETAILS}" = "ShowDetails" ] then echo " ${PLATFORM}" TIME=`grep "^${SUITE} " ${PLATFORM}/${REVISION}.csv | gawk '{ print $6 }'` #DEBUG echo "${SUITE}: ${RES}" if [ "${TIME}" = "" ] then RES="" echo -n "${RES}" >> ${HISTORY} 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="" # echo ${RES} if [ "${SHOWDETAILS}" = "ShowDetails" ] then echo -n "" >> ${HISTORY} echo -n "" >> ${HISTORY} else echo -n "" >> ${HISTORY} fi fi fi done # PLATFORMS Duration echo "" >> ${HISTORY} # fi # SHOWDETAILS done # REVISIONS # Show baseline info for each platform: echo "" >> ${HISTORY} echo "" >> ${HISTORY} 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 "" >> ${HISTORY} fi done # PLATFORMS echo "" >> ${HISTORY} echo "
${SUITE} ${PLATF}" >> ${HISTORY} fi done # PLATFORMS echo "
${HEAD}
${REVISION}
${TS}
"$NA""$NA""$NA""$NA"${NUMBER}${OK}${FAILED}${SKIPPED}
Duration:"$NA""${TIME} ${PERCENT}"" >> ${HISTORY} echo -n " ${TIME} " >> ${HISTORY} echo -n "" >> ${HISTORY} echo -n " ${PERCENT}% " >> ${HISTORY} echo -n "" >> ${HISTORY} echo -n " ${PERCENT}% " >> ${HISTORY} echo -n "
Baseline for duration
percent is rev.:
${BASELINE}
${TS}
(${PLATF})
" >> ${HISTORY} echo "
" >> ${HISTORY} echo "
" >> ${HISTORY} echo "" >> ${HISTORY} date +%Y-%m-%d" "%H:%M:%S" "%Z >> ${HISTORY} echo "" >> ${HISTORY} echo "
" >> ${HISTORY} chmod go+r ${HISTORY} if [ "${SHOWDETAILS}" != "ShowDetails" ] then DTIPUB="${PUBLISHDIR}/${PRESENTATION}/${SUITE}_history.html" SRC="${HISTORY}" DST="${DTIPUB}" echo "**** OBS! ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST}" ${SCPUT} ${SRC} ${PUBLISHUSER}@${PUBLISHSITE}:${DST} fi done # SUITES