dash/ci/test_integrationtests.sh
MarcoFalke 652a36b0f2 Merge #15943: tests: Fail if RPC has been added without tests
fad0ce59e9 tests: Fail if RPC has been added without tests (MarcoFalke)

Pull request description:

  Need to be run with --coverage

ACKs for commit fad0ce:
  ryanofsky:
    utACK fad0ce59e9154f9b7e61907a71c740a942c60282. New comment in travis.yml is the only change since last review.

Tree-SHA512: b53632dfe9865ec06991bfcba2fd67238bebbb866b355f09624eaf233257b2bca902caac6c24abb358b2f4c1c43f28ca75e30982765911e1a117102df65276d9
2021-10-12 15:56:33 -07:00

66 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# This script is executed inside the builder image
export LC_ALL=C.UTF-8
set -e
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
R=$(($RANDOM%3))
if [ "$R" == "0" ]; then
SOCKETEVENTS="select"
elif [ "$R" == "1" ]; then
SOCKETEVENTS="poll"
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 ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
RESULT=$?
set -e
echo "Collecting logs..."
BASEDIR=$(ls testdatadirs)
if [ "$BASEDIR" != "" ]; then
mkdir testlogs
TESTDATADIRS=$(ls testdatadirs/$BASEDIR)
for d in $TESTDATADIRS; do
[[ "$d" ]] || break # found nothing
[[ "$d" != "cache" ]] || continue # skip cache dir
mkdir testlogs/$d
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
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