dash/ci/dash/test_integrationtests.sh
Konstantin Akimov 097a8e7196
non-scripted-diff: bump copyright year to 2023
that's a result of:
contrib/devtools/copyright_header.py update ./

it is not scripted diff, because it works differentlly on my localhost and in CI:
CI doesn't want to use git commit date which is mocked to 30th Dec of 2023
2024-02-24 11:05:37 -06:00

75 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2018-2024 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This script is executed inside the builder image
export LC_ALL=C.UTF-8
set -e
PASS_ARGS="$*"
source ./ci/dash/matrix.sh
if [ "$RUN_FUNCTIONAL_TESTS" != "true" ]; then
echo "Skipping integration tests"
exit 0
fi
export LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib
if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
echo "Downloading previous releases: $PREVIOUS_RELEASES_TO_DOWNLOAD"
./test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" ${PREVIOUS_RELEASES_TO_DOWNLOAD}
fi
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
LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${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
# Disabled creation of combined.html: 40% smaller CI job artifacts
# 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