git-lfs/script/integration
2015-05-21 15:01:44 -06:00

51 lines
893 B
Bash
Executable File

#!/bin/sh
. "test/testenv.sh"
set -e
SHUTDOWN_LFS=no
SHOW_LOGS=yes
atexit() {
res=${1:-$?}
SHUTDOWN_LFS=yes
if [ "$res" = "0" ]; then
SHOW_LOGS=no
fi
if [ "$SHOW_LOGS" = "yes" ]; then
if [ -s "$REMOTEDIR/gitserver.log" ]; then
echo ""
echo "gitserver.log:"
cat "$REMOTEDIR/gitserver.log"
fi
echo ""
echo "env:"
env
fi
shutdown
exit $res
}
trap "atexit" EXIT
if [ -s "$LFS_URL_FILE" ]; then
SHOW_LOGS=no
echo "$LFS_URL_FILE still exists!"
echo "Confirm other tests are done, and run:"
echo " $ curl $(cat "$LFS_URL_FILE")/shutdown"
exit 1
fi
setup
parallel=${GIT_LFS_TEST_MAXPROCS:-4}
echo "Running this maxprocs=$parallel"
for file in test/test-*.sh; do
echo "0$(cat .$(basename $file).time 2>/dev/null || true) $file"
done | sort -rnk1 | awk '{ print $2 }' | xargs -I % -P $parallel -n 1 /bin/sh -c % --batch