1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

tests: always clean the test directory

previously the test directory could have been left untouched before executing
a test when `init.sh` was not run - and sometimes it isn't
supposed to be run - which made the test suite highly stateful and thus
behaving surprisingly on multiple runs.
This commit is contained in:
Valentin Gagarin 2024-05-13 14:56:14 +02:00
parent 33ca905cdb
commit 7822ecbadf

View file

@ -1,10 +1,8 @@
test -n "$TEST_ROOT" test -n "$TEST_ROOT"
if test -d "$TEST_ROOT"; then # We would delete any daemon socket, so let's stop the daemon first.
chmod -R u+rw "$TEST_ROOT" killDaemon
# We would delete any daemon socket, so let's stop the daemon first. # Destroy the test directory that may have persisted from previous runs
killDaemon rm -rf "$TEST_ROOT"
rm -rf "$TEST_ROOT"
fi
mkdir -p "$TEST_ROOT" mkdir -p "$TEST_ROOT"
mkdir "$TEST_HOME" mkdir "$TEST_HOME"