dash/ci/test_integrationtests.sh

66 lines
1.6 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2020-07-29 15:24:36 +02:00
#
# This script is executed inside the builder image
2020-07-29 15:24:36 +02:00
export LC_ALL=C
set -e
2020-07-29 15:42:12 +02:00
PASS_ARGS="$*"
source ./ci/matrix.sh
if [ "$RUN_INTEGRATIONTESTS" != "true" ]; then
echo "Skipping integration tests"
exit 0
fi
export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
cd build-ci/dashcore-$BUILD_TARGET
if [ "$SOCKETEVENTS" = "" ]; then
# Let's switch socketevents mode to some random mode
2020-04-07 17:58:38 +02:00
R=$(($RANDOM%3))
if [ "$R" == "0" ]; then
SOCKETEVENTS="select"
2020-04-07 17:58:38 +02:00
elif [ "$R" == "1" ]; then
SOCKETEVENTS="poll"
2020-04-07 17:58:38 +02:00
else
SOCKETEVENTS="epoll"
fi
fi
echo "Using socketevents mode: $SOCKETEVENTS"
EXTRA_ARGS="--dashd-arg=-socketevents=$SOCKETEVENTS"
set +e
./test/functional/test_runner.py --ci --combinedlogslen=4000 --coverage --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
RESULT=$?
set -e
echo "Collecting logs..."
BASEDIR=$(ls testdatadirs)
if [ "$BASEDIR" != "" ]; then
mkdir testlogs
2020-07-30 02:11:35 +02:00
TESTDATADIRS=$(ls testdatadirs/$BASEDIR)
for d in $TESTDATADIRS; do
[[ "$d" ]] || break # found nothing
[[ "$d" != "cache" ]] || continue # skip cache dir
mkdir testlogs/$d
./test/functional/combine_logs.py -c ./testdatadirs/$BASEDIR/$d > ./testlogs/$d/combined.log
./test/functional/combine_logs.py --html ./testdatadirs/$BASEDIR/$d > ./testlogs/$d/combined.html
cd testdatadirs/$BASEDIR/$d
LOGFILES="$(find . -name 'debug.log' -or -name "test_framework.log")"
cd ../../..
for f in $LOGFILES; do
d2="testlogs/$d/$(dirname $f)"
mkdir -p $d2
cp testdatadirs/$BASEDIR/$d/$f $d2/
done
done
fi
mv testlogs ../../
exit $RESULT