From ea44f6089c5813a20f221792e67ff94723205a81 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 9 May 2023 00:52:07 +0200 Subject: end-to-end tests: be independent of the user's home directory ... and, in particular, do not read any rc files for just-mr the user might have. --- test/end-to-end/gc/export.sh | 2 +- test/end-to-end/git-import/chained-import.sh | 2 +- test/end-to-end/just-mr/cas-independent.sh | 4 ++-- test/end-to-end/just-mr/defaults.sh | 8 ++++---- test/end-to-end/just-mr/fetch-gc.sh | 6 +++--- test/end-to-end/just-mr/fetch.sh | 6 +++--- test/end-to-end/just-mr/install-roots.sh | 2 +- test/end-to-end/just-mr/verbosity.sh | 4 ++-- test/end-to-end/remote-execution/native-protocol.sh | 2 +- test/end-to-end/target-cache/target-cache-hit.sh | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/end-to-end/gc/export.sh b/test/end-to-end/gc/export.sh index 793ff8a1..15b151ef 100644 --- a/test/end-to-end/gc/export.sh +++ b/test/end-to-end/gc/export.sh @@ -22,7 +22,7 @@ readonly LBR="${TEST_TMPDIR}/local-build-root" readonly LBR_MR="${TEST_TMPDIR}/local-build-root-mr" readonly TOOLS_DIR="${TEST_TMPDIR}/tools" readonly OUT="${TEST_TMPDIR}/out" -readonly JUST_MR_ARGS="--just ${JUST} --local-build-root ${LBR_MR}" +readonly JUST_MR_ARGS="--norc --just ${JUST} --local-build-root ${LBR_MR}" BUILD_ARGS="--local-build-root ${LBR}" if [ -n "${COMPATIBLE:-}" ]; then BUILD_ARGS="$BUILD_ARGS --compatible" diff --git a/test/end-to-end/git-import/chained-import.sh b/test/end-to-end/git-import/chained-import.sh index 8eba65ab..e9f98198 100755 --- a/test/end-to-end/git-import/chained-import.sh +++ b/test/end-to-end/git-import/chained-import.sh @@ -82,7 +82,7 @@ EOF echo cat repos.json echo -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" install -o "${OUT}" 2>&1 +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" install -o "${OUT}" 2>&1 echo cat "${OUT}/out.txt" echo diff --git a/test/end-to-end/just-mr/cas-independent.sh b/test/end-to-end/just-mr/cas-independent.sh index 04e03687..1dceb01f 100644 --- a/test/end-to-end/just-mr/cas-independent.sh +++ b/test/end-to-end/just-mr/cas-independent.sh @@ -64,7 +64,7 @@ cat repos.json # Call just-mr with distdir present -FIRST_CONFIG=$("${JUST_MR}" --local-build-root "${LBR}" --distdir "${DISTDIR}" setup) +FIRST_CONFIG=$("${JUST_MR}" --norc --local-build-root "${LBR}" --distdir "${DISTDIR}" setup) echo "Config on first set (with everything available) ${FIRST_CONFIG}" cat "${FIRST_CONFIG}" @@ -80,7 +80,7 @@ rm -rf "${DISTDIR}" # Call just-mr again, with map-files and git prefilled from first run, # but CAS and distdir missing. -SECOND_CONFIG=$("${JUST_MR}" --local-build-root "${LBR}" setup) +SECOND_CONFIG=$("${JUST_MR}" --norc --local-build-root "${LBR}" setup) [ -f "${SECOND_CONFIG}" ] [ "${FIRST_CONFIG}" = "${SECOND_CONFIG}" ] diff --git a/test/end-to-end/just-mr/defaults.sh b/test/end-to-end/just-mr/defaults.sh index de641ab2..57b020f6 100644 --- a/test/end-to-end/just-mr/defaults.sh +++ b/test/end-to-end/just-mr/defaults.sh @@ -148,24 +148,24 @@ test "$(cat "${PARSE_DIR}/launcher")" = 'null' ## Command-line -D # ignored on non-build commands -"${JUST_MR}" --local-build-root "${LBR}" --just "${PARSE}" \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${PARSE}" \ -D 'this is not json' version "${PARSE_DIR}" 2>&1 test $(jq '. == [] ' "${PARSE_DIR}/defines") = "true" # not forwarded, if empty -"${JUST_MR}" --local-build-root "${LBR}" --just "${PARSE}" \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${PARSE}" \ -D '{}' build "${PARSE_DIR}" 2>&1 test $(jq '. == [] ' "${PARSE_DIR}/defines") = "true" # combined on forwarding -"${JUST_MR}" --local-build-root "${LBR}" --just "${PARSE}" \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${PARSE}" \ -D '{"foo": "bar"}' -D '{"baz": "baz"}' -D '{"foo": "override"}' \ build "${PARSE_DIR}" 2>&1 test $(jq '. == [ {"foo": "override", "baz": "baz"}] ' "${PARSE_DIR}/defines") = true # but passed arguments are given separately -"${JUST_MR}" --local-build-root "${LBR}" --just "${PARSE}" \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --just "${PARSE}" \ -D '{"foo": "bar"}' -D '{"baz": "baz"}' \ build -D '{"foo": "override"}' -D '{"x": "y"}' "${PARSE_DIR}" 2>&1 test $(jq '. == [ {"foo": "bar", "baz": "baz"}, {"foo": "override"}, {"x": "y"}] ' "${PARSE_DIR}/defines") = true diff --git a/test/end-to-end/just-mr/fetch-gc.sh b/test/end-to-end/just-mr/fetch-gc.sh index c2a1d86c..8433a780 100644 --- a/test/end-to-end/just-mr/fetch-gc.sh +++ b/test/end-to-end/just-mr/fetch-gc.sh @@ -68,14 +68,14 @@ EOF # Call just-mr setup. This will also create a cache entry for the tree # corresponding to that archive -"${JUST_MR}" --local-build-root "${LBR}" --distdir "${DISTDIR}" setup 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --distdir "${DISTDIR}" setup 2>&1 # Remove entry from CAS "${JUST}" gc --local-build-root "${LBR}" 2>&1 "${JUST}" gc --local-build-root "${LBR}" 2>&1 # Fetch should still work, if given access to the original file -"${JUST_MR}" --local-build-root "${LBR}" --distdir "${DISTDIR}" \ +"${JUST_MR}" --norc --local-build-root "${LBR}" --distdir "${DISTDIR}" \ fetch -o "${FETCH_TO_DIR}" 2>&1 newfoocontent=$(git hash-object "${DISTDIR}/foo-1.2.3.tar") echo "Foo archive has now content ${newfoocontent}" @@ -88,7 +88,7 @@ rm -rf "${DISTDIR}" rm -rf "${FETCH_TO_DIR}" # Setup for building should still be possible -"${JUST_MR}" --just "${JUST}" --local-build-root "${LBR}" \ +"${JUST_MR}" --norc --just "${JUST}" --local-build-root "${LBR}" \ install -o "${INSTALL_DIR}" 2>&1 test "$(cat "${INSTALL_DIR}/out.txt")" = "${TEST_DATA}" diff --git a/test/end-to-end/just-mr/fetch.sh b/test/end-to-end/just-mr/fetch.sh index 16c86c7c..323db6d1 100644 --- a/test/end-to-end/just-mr/fetch.sh +++ b/test/end-to-end/just-mr/fetch.sh @@ -52,14 +52,14 @@ cat repos.json # Call just-mr with distdir present, to make it aware of the file -"${JUST_MR}" --local-build-root "${LBR}" --distdir "${DISTDIR}" setup 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" --distdir "${DISTDIR}" setup 2>&1 # Remove distdir content rm -rf "${DISTDIR}" mkdir -p "${DISTDIR}" # Ask just-mr to fetch to the empty distdir -"${JUST_MR}" --local-build-root "${LBR}" fetch -o "${DISTDIR}" 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" fetch -o "${DISTDIR}" 2>&1 # Verify that the correct file is stored in the distdir test -f "${DISTDIR}/foo-1.2.3.tar" @@ -68,7 +68,7 @@ echo "Foo archive has now content ${newfoocontent}" test "${newfoocontent}" = "${foocontent}" # Verify that fetching accepts distfiles already present -"${JUST_MR}" --local-build-root "${LBR}" fetch -o "${DISTDIR}" 2>&1 +"${JUST_MR}" --norc --local-build-root "${LBR}" fetch -o "${DISTDIR}" 2>&1 newfoocontent=$(git hash-object "${DISTDIR}/foo-1.2.3.tar") echo "Foo archive has now content ${newfoocontent}" test "${newfoocontent}" = "${foocontent}" diff --git a/test/end-to-end/just-mr/install-roots.sh b/test/end-to-end/just-mr/install-roots.sh index 0350734b..1df1c1ba 100644 --- a/test/end-to-end/just-mr/install-roots.sh +++ b/test/end-to-end/just-mr/install-roots.sh @@ -57,7 +57,7 @@ cat > repos.json <log && exit 1 || : cat log grep -q -F "${TOOL_MSG_A}" log @@ -86,7 +86,7 @@ echo echo testing setup success echo -CONF=$("${JUST_MR}" --local-build-root "${LBR}" \ +CONF=$("${JUST_MR}" --norc --local-build-root "${LBR}" \ -L '["env", "SHOULD_FAIL="]' setup 2>log) cat log echo "${CONF}" diff --git a/test/end-to-end/remote-execution/native-protocol.sh b/test/end-to-end/remote-execution/native-protocol.sh index 3257570f..3ff3a050 100644 --- a/test/end-to-end/remote-execution/native-protocol.sh +++ b/test/end-to-end/remote-execution/native-protocol.sh @@ -66,7 +66,7 @@ cat > TARGETS <&1 "$JUST" build -C "$CONF" main --local-build-root="$LBRDIR" $ARGS 2>&1 -- cgit v1.2.3