Revise run-and-email scripts.

This commit is contained in:
rocky
2020-01-11 18:12:23 -05:00
parent 9eda8926a3
commit 651170db9a
2 changed files with 66 additions and 26 deletions

View File

@@ -27,30 +27,33 @@ for VERSION in $PYVERSIONS ; do
typeset -i rc=0 typeset -i rc=0
LOGFILE=/tmp/pyenvlib-$VERSION-$$.log LOGFILE=/tmp/pyenvlib-$VERSION-$$.log
if [[ $VERSION == '3.5.9' ]] ; then case "$VERSION" in
MAX_TESTS=237 # We start failing on "mailbox" at 238 3.7.6 | 3.8.1 | 3.1.5 | 3.0.1 )
elif [[ $VERSION == '3.2.6' ]] ; then continue
MAX_TESTS=172 # We start failing on pkgutil.py ;;
elif [[ $VERSION == '3.3.7' ]] ; then 3.5.9 )
MAX_TESTS=180 # We start failing on pkgutil.py MAX_TESTS=237 # We start failing on "mailbox" at 238
elif [[ $VERSION == '3.4.10' ]] ; then ;;
MAX_TESTS=30 # We start failing on aifc 3.2.6 )
elif [[ $VERSION == '3.6.9' ]] ; then MAX_TESTS=172 # We start failing on pkgutil.py
MAX_TESTS=92 # We start failing on cgiltb.py ;;
elif [[ $VERSION == '3.7.6' ]] ; then 3.3.7 )
continue MAX_TESTS=180 # We start failing on pkgutil.py
elif [[ $VERSION == '3.8.1' ]] ; then ;;
continue 3.4.10 )
elif [[ $VERSION == '3.1.5' ]] ; then MAX_TESTS=30 # We start failing on aifc
continue ;;
elif [[ $VERSION == '3.0.1' ]] ; then 3.6.9 )
continue MAX_TESTS=92 # We start failing on cgiltb.py
elif [[ $VERSION == '2.6.9' ]] ; then ;;
MAX_TESTS=1300 2.6.9 )
continue MAX_TESTS=1300
else ;;
MAX_TESTS=800 * )
fi MAX_TESTS=800
;;
esac
actual_versions="$actual_versions $VERSION" actual_versions="$actual_versions $VERSION"
if ! pyenv local $VERSION ; then if ! pyenv local $VERSION ; then

View File

@@ -1,16 +1,48 @@
#!/bin/bash #!/bin/bash
function displaytime {
printf "ran in "
local T=$1
local D=$((T/60/60/24))
local H=$((T/60/60%24))
local M=$((T/60%60))
local S=$((T%60))
(( $D > 0 )) && printf '%d days ' $D
(( $H > 0 )) && printf '%d hours ' $H
(( $M > 0 )) && printf '%d minutes ' $M
(( $D > 0 || $H > 0 || $M > 0 )) && printf 'and '
printf '%d seconds\n' $S
}
. ../../admin-tools/pyenv-newer-versions
USER=${USER:-rocky} USER=${USER:-rocky}
EMAIL=${EMAIL:-rb@dustyfeet.com} EMAIL=${EMAIL:-rb@dustyfeet.com}
SUBJECT_PREFIX="stdlib unit testing for" SUBJECT_PREFIX="stdlib unit testing for"
for VERSION in 2.6.9 2.7.17 3.4.10 3.5.9 3.6.9 ; do
typeset -i RUN_STARTTIME=$(date +%s)
actual_versions=""
DEBUG="" # -x
for VERSION in $PYVERSIONS ; do
typeset -i rc=0 typeset -i rc=0
LOGFILE=/tmp/runtests-$VERSION-$$.log LOGFILE=/tmp/runtests-$VERSION-$$.log
case "$VERSION" in
3.0.1 | 3.1.5 | 3.2.6 | 3.7.6 | 3.8.1 )
continue
;;
esac
actual_versions="$actual_versions $VERSION"
if ! pyenv local $VERSION ; then if ! pyenv local $VERSION ; then
rc=1 rc=1
else else
/bin/bash ./runtests.sh >$LOGFILE 2>&1 STOP_ONERROR=0 /bin/bash $DEBUG ./runtests.sh >$LOGFILE 2>&1
rc=$? rc=$?
fi fi
SUBJECT_PREFIX="runtests verify for"
if ((rc == 0)); then if ((rc == 0)); then
tail -v $LOGFILE | mail -s "$SUBJECT_PREFIX $VERSION ok" ${USER}@localhost tail -v $LOGFILE | mail -s "$SUBJECT_PREFIX $VERSION ok" ${USER}@localhost
else else
@@ -18,3 +50,8 @@ for VERSION in 2.6.9 2.7.17 3.4.10 3.5.9 3.6.9 ; do
tail -v $LOGFILE | mail -s "$SUBJECT_PREFIX $VERSION not ok" $EMAIL tail -v $LOGFILE | mail -s "$SUBJECT_PREFIX $VERSION not ok" $EMAIL
fi fi
done done
typeset -i RUN_ENDTIME=$(date +%s)
(( time_diff = RUN_ENDTIME - RUN_STARTTIME))
elapsed_time=$(displaytime $time_diff)
echo "Run complete $elapsed_time for versions $actual_versions" | mail -s "runtests in $elapsed_time" ${EMAIL}