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/repeated-gc.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/end-to-end/just-mr/repeated-gc.sh') diff --git a/test/end-to-end/just-mr/repeated-gc.sh b/test/end-to-end/just-mr/repeated-gc.sh index 3b7bf62e..f4fa3ce6 100755 --- a/test/end-to-end/just-mr/repeated-gc.sh +++ b/test/end-to-end/just-mr/repeated-gc.sh @@ -84,18 +84,18 @@ grep VALUES "${OUT}/out.txt" # Before rotation the git root should still exist [ -e "${GIT_ROOT}" ] -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 # After gc rotation, the original git root should no longer exist [ -e "${GIT_ROOT}" ] && exit 1 || : -"${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 # Building should nevertheless succeed, due to the old repo generation # ===================================================================== -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" \ +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 # sanity check grep VALUES "${OUT}/out.txt" @@ -113,12 +113,12 @@ GIT_ROOT=$(jq -r '.repositories.""."workspace_root" | .[2]' "${CONF}") echo "Git root is ${GIT_ROOT}" [ -e "${GIT_ROOT}" ] -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 [ -e "${GIT_ROOT}" ] && exit 1 || : -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --local-build-root "${LBR}" --just "${JUST}" gc 2>&1 -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" \ +"${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 --just "${JUST}" --local-build-root "${LBR}" \ -L '["env", "PATH='"${PATH}"'"]' install -o "${OUT}" 2>&1 grep VALUES "${OUT}/out.txt" rm -f "${OUT}/out.txt" @@ -128,8 +128,8 @@ done # Finally demonstrate that the root was not taken from anything but the cache # =========================================================================== -"${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}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${JUST}" gc-repo 2>&1 # after full rotation of the repository, the root should be lost "${JUST_MR}" --norc --local-build-root "${LBR}" -f "${OUT}/log" \ -- cgit v1.2.3