Skip to content

Commit e32de6b

Browse files
committed
Be explicit about environment variables for tests.
This will make it easier to reproduce a test failure by cut-and-paste of the corresponding line from the github log.
1 parent 77a3e6b commit e32de6b

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/run_test.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,31 @@ output_failed_logs() {
3333
}
3434
trap output_failed_logs 0
3535

36+
env=""
37+
if [ ! -z "${SUDO}" ]; then
38+
env="${env} SUDO=${SUDO}"
39+
fi
3640
if [ ! -z "${TCMALLOC_STACKTRACE_METHOD}" ]; then
37-
echo TCMALLOC_STACKTRACE_METHOD="${TCMALLOC_STACKTRACE_METHOD}"
38-
echo export TCMALLOC_STACKTRACE_METHOD
39-
export TCMALLOC_STACKTRACE_METHOD
41+
env="${env} TCMALLOC_STACKTRACE_METHOD=${TCMALLOC_STACKTRACE_METHOD}"
42+
fi
43+
if [ ! -z "${TEST_SSH_SSHD_ENV}" ]; then
44+
env="${env} TEST_SSH_SSHD_ENV=${TEST_SSH_SSHD_ENV}"
45+
fi
46+
if [ ! -z "${env}" ]; then
47+
env="env${env}"
4048
fi
4149

4250
if [ -z "${LTESTS}" ]; then
43-
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}"
51+
${env} make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}"
4452
else
45-
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}"
53+
${env} make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}"
4654
fi
4755

4856
if [ ! -z "${SSHD_CONFOPTS}" ]; then
4957
echo "rerunning t-exec with TEST_SSH_SSHD_CONFOPTS='${SSHD_CONFOPTS}'"
5058
if [ -z "${LTESTS}" ]; then
51-
make t-exec SKIP_LTESTS="${SKIP_LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
59+
${env} make t-exec SKIP_LTESTS="${SKIP_LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
5260
else
53-
make t-exec SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
61+
${env} make t-exec SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
5462
fi
5563
fi

0 commit comments

Comments
 (0)