2018-07-12 15:28:59 +02:00
|
|
|
#!/usr/bin/env bash
|
2020-07-29 15:24:36 +02:00
|
|
|
#
|
2018-07-12 15:28:59 +02:00
|
|
|
# This script is executed inside the builder image
|
|
|
|
|
2018-08-27 15:33:59 +02:00
|
|
|
export LC_ALL=C.UTF-8
|
2020-07-29 15:24:36 +02:00
|
|
|
|
2018-07-12 15:28:59 +02:00
|
|
|
set -e
|
|
|
|
|
2020-07-29 15:42:12 +02:00
|
|
|
PASS_ARGS="$*"
|
2018-11-15 08:04:58 +01:00
|
|
|
|
2018-07-12 15:28:59 +02:00
|
|
|
source ./ci/matrix.sh
|
|
|
|
|
2019-05-22 23:21:21 +02:00
|
|
|
if [ "$RUN_INTEGRATIONTESTS" != "true" ]; then
|
2018-07-12 15:28:59 +02:00
|
|
|
echo "Skipping integration tests"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
|
|
|
|
|
|
|
|
cd build-ci/dashcore-$BUILD_TARGET
|
|
|
|
|
2020-04-16 11:24:12 +02:00
|
|
|
if [ "$SOCKETEVENTS" = "" ]; then
|
|
|
|
# Let's switch socketevents mode to some random mode
|
2021-10-23 23:52:41 +02:00
|
|
|
R=$((RANDOM%3))
|
2020-04-16 11:24:12 +02:00
|
|
|
if [ "$R" == "0" ]; then
|
|
|
|
SOCKETEVENTS="select"
|
2020-04-07 17:58:38 +02:00
|
|
|
elif [ "$R" == "1" ]; then
|
2020-04-16 11:24:12 +02:00
|
|
|
SOCKETEVENTS="poll"
|
2020-04-07 17:58:38 +02:00
|
|
|
else
|
|
|
|
SOCKETEVENTS="epoll"
|
2020-04-16 11:24:12 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "Using socketevents mode: $SOCKETEVENTS"
|
|
|
|
EXTRA_ARGS="--dashd-arg=-socketevents=$SOCKETEVENTS"
|
|
|
|
|
2019-10-16 11:48:46 +02:00
|
|
|
set +e
|
2019-05-15 21:49:48 +02:00
|
|
|
./test/functional/test_runner.py --ci --combinedlogslen=4000 ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
|
2019-10-16 11:48:46 +02:00
|
|
|
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
|
2019-10-16 11:48:46 +02:00
|
|
|
mkdir testlogs/$d
|
2020-11-04 03:09:17 +01:00
|
|
|
PYTHONIOENCODING=UTF-8 ./test/functional/combine_logs.py -c ./testdatadirs/$BASEDIR/$d > ./testlogs/$d/combined.log
|
|
|
|
PYTHONIOENCODING=UTF-8 ./test/functional/combine_logs.py --html ./testdatadirs/$BASEDIR/$d > ./testlogs/$d/combined.html
|
2019-10-16 11:48:46 +02:00
|
|
|
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
|