check: define TMPDIR before running the test
PATCH 1/1 check: define TMPDIR before running the test
The TMPDIR was defined in _call_test before running test_func, but it was used in nvme/rc which has not yet defined, so move the definiation before runng the test to fix it.
--- check | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
check +4 -3
@@ -364,9 +364,6 @@ _call_test() { unset TEST_CLEANUP trap _cleanup EXIT - if ! TMPDIR="$(mktemp --tmpdir -p "$OUTPUT" -d "tmpdir.${TEST_NAME//\//.}.XXX")"; then - return - fi TIMEFORMAT="%Rs" pushd . >/dev/null || return
@@ -478,6 +475,10 @@ _run_test() { # runs to suppress job status output. set +m + if ! TMPDIR="$(mktemp --tmpdir -p "$OUTPUT" -d "tmpdir.${TEST_NAME//\//.}.XXX")"; then + return + fi + # shellcheck disable=SC1090 . "tests/${TEST_NAME}"
Signature · 1 line
2.34.3
Hi,
check _run_test() { · line 483
Quoted 10 lines · Yi Zhang
check +4
-0@@ -478,6 +475,10 @@ _run_test() { # runs to suppress job status output. set +m + if ! TMPDIR="$(mktemp --tmpdir -p "$OUTPUT" -d "tmpdir.${TEST_NAME//\//.}.XXX")"; then + return + fi + # shellcheck disable=SC1090 . "tests/${TEST_NAME}"
Are you sure about the placement here? I went through the call chain and I figured that the TMPDIR should be set in _run_group before we call the 'rc' files.
Currently it is:
_check
_run_group
tests/${group}/rc
_run_test
_call_test
TMPDIR=...
$test_funcThanks,
Daniel
Quoted 8 lines · Daniel Wagner
Hi,
Quoted 4 lines · Yi Zhang
check +0
-0@@ -478,6 +475,10 @@ _run_test() { # runs to suppress job status output. set +m
Quoted 10 lines
check _run_test() { · line 483
Quoted 6 lines
check +4
-0+ if ! TMPDIR="$(mktemp --tmpdir -p "$OUTPUT" -d "tmpdir.${TEST_NAME//\//.}.XXX")"; then + return + fi + # shellcheck disable=SC1090 . "tests/${TEST_NAME}"Are you sure about the placement here? I went through the call chain and I figured that the TMPDIR should be set in
_run_groupbefore we call the 'rc' files.
Yeah, you are right, just send v2 for the change.
Quoted 14 lines
Currently it is:
_check
_run_grouptests/${group}/rc _run_test _call_test TMPDIR=... $test_funcThanks,
Daniel
Signature · 2 lines
Best Regards, Yi Zhang