Skip to content

Commit d80318d

Browse files
committed
Merge bitcoin/bitcoin#28954: ci: Reduce use of bash -c
fad82fe ci: Reduce use of bash -c (MarcoFalke) fafcee4 ci: Rename test script to 03_test_script.sh (MarcoFalke) Pull request description: It is confusing to treat commands as a single string. This change is also required to support paths and strings with spaces in them in the future. ACKs for top commit: RandyMcMillan: utACK fad82fe vasild: ACK fad82fe Tree-SHA512: fb79469d809400739e53da203842fda838f2ec9ab8dcd5e622ccd3db651d629161323bfcc04301562f13f5c407e8865036478a4ac7f6b5265dc4dda1a320c23d
2 parents c4d47d2 + fad82fe commit d80318d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

ci/test/00_setup_env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export RUN_TIDY=${RUN_TIDY:-false}
4646
# This is needed because some ci machines have slow CPU or disk, so sanitizers
4747
# might be slow or a reindex might be waiting on disk IO.
4848
export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-40}
49-
export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-}
5049
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
5150

5251
# Randomize test order.

ci/test/00_setup_env_i686_multiprocess.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \
1616
LDFLAGS='--rtlib=compiler-rt -lgcc_s' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
17-
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
17+
export BITCOIND=bitcoin-node # Used in functional tests

ci/test/02_run_container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ CI_EXEC git config --global --add safe.directory \"*\"
8484

8585
CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}"
8686

87-
CI_EXEC "${BASE_ROOT_DIR}/ci/test/06_script_b.sh"
87+
CI_EXEC "${BASE_ROOT_DIR}/ci/test/03_test_script.sh"
8888

8989
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
9090
echo "Stop and remove CI container by ID"

ci/test/06_script_b.sh renamed to ci/test/03_test_script.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,16 @@ if [ -n "$USE_VALGRIND" ]; then
163163
fi
164164

165165
if [ "$RUN_UNIT_TESTS" = "true" ]; then
166-
bash -c "${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib make $MAKEJOBS check VERBOSE=1"
166+
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" make "${MAKEJOBS}" check VERBOSE=1
167167
fi
168168

169169
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
170-
bash -c "${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib ${BASE_OUTDIR}/bin/test_bitcoin --catch_system_errors=no -l test_suite"
170+
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}"/bin/test_bitcoin --catch_system_errors=no -l test_suite
171171
fi
172172

173173
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
174-
bash -c "LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib ${TEST_RUNNER_ENV} test/functional/test_runner.py --ci $MAKEJOBS --tmpdirprefix ${BASE_SCRATCH_DIR}/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --quiet --failfast"
174+
# shellcheck disable=SC2086
175+
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" ${TEST_RUNNER_EXTRA} --quiet --failfast
175176
fi
176177

177178
if [ "${RUN_TIDY}" = "true" ]; then
@@ -200,5 +201,6 @@ if [ "${RUN_TIDY}" = "true" ]; then
200201
fi
201202

202203
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
203-
bash -c "LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} $MAKEJOBS -l DEBUG ${DIR_FUZZ_IN} --empty_min_time=60"
204+
# shellcheck disable=SC2086
205+
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60
204206
fi

0 commit comments

Comments
 (0)