From a045db67a4b9e388e66dc80f33e8548465546fc4 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 23 Apr 2025 09:33:56 +0200 Subject: Make end-to-end tests independent of the user's configuration End-to-end tests should, like all tests, be independent of any non-project files the user has in their home directory. This also applies when running the tests locally. In particular, end-to-end tests should not read the user's ~/.just-mrrc. Therefore, properly set --norc in all end-to-end tests (where this is not already the case). --- test/end-to-end/just-mr/gc-drop.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'test/end-to-end/just-mr/gc-drop.sh') diff --git a/test/end-to-end/just-mr/gc-drop.sh b/test/end-to-end/just-mr/gc-drop.sh index 5bd46996..ce609a48 100644 --- a/test/end-to-end/just-mr/gc-drop.sh +++ b/test/end-to-end/just-mr/gc-drop.sh @@ -106,13 +106,13 @@ EOF cat repos.json # archive a -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" --main a \ +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" --main a \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 # ... sanity check grep VALUES "${OUT}/out.txt" # archive b -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" --main b \ +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" --main b \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 # ... sanity check grep 42 "${OUT}/out.txt" @@ -120,11 +120,11 @@ grep 42 "${OUT}/out.txt" # Rotate, and use a again # ======================= -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" --main a \ +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" --main a \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 grep VALUES "${OUT}/out.txt" @@ -137,15 +137,15 @@ grep VALUES "${OUT}/out.txt" # clean up b, which should result in reduced disk usage. # get rid of CAS/cahe -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 # measure disk usage PRE_DROP_DISK=$(du -sb "${LBR}" | cut -f 1) echo "Pre drop, disk usage is ${PRE_DROP_DISK}" # drop -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo --drop-only 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo --drop-only 2>&1 # measure disk usage @@ -157,21 +157,21 @@ echo "Post drop, disk usage is ${POST_DROP_DISK}" # Verify that a is still in the youngest generation: even after one more # rotation, we should be able to build a. -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" --main a \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" --main a \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 grep VALUES "${OUT}/out.txt" # Finally demonstrate that the root was not taken from anything but the cache # =========================================================================== -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" --main a \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" --main a \ -L '["env", "PATH='"${PATH}"'"]' build 2>&1 && exit 1 || : echo OK -- cgit v1.2.3