From 5706fabb8270910188d0234c693c20b8eb82223f Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 21 Sep 2023 17:02:27 +0200 Subject: Add regression test that --fetch-absent does not store a subtree ... as tree for the whole commit, and thus pollutes subsequent builds. --- test/end-to-end/just-mr/fetch-absent.sh | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'test') diff --git a/test/end-to-end/just-mr/fetch-absent.sh b/test/end-to-end/just-mr/fetch-absent.sh index 2a753bc5..16f1877f 100644 --- a/test/end-to-end/just-mr/fetch-absent.sh +++ b/test/end-to-end/just-mr/fetch-absent.sh @@ -23,6 +23,7 @@ readonly JUST_MR="${PWD}/bin/mr-tool-under-test" readonly LBR="${TEST_TMPDIR}/local-build-root" readonly OUT="${TEST_TMPDIR}/out" readonly OUT2="${TEST_TMPDIR}/out2" +readonly OUT3="${TEST_TMPDIR}/out3" mkdir work cd work @@ -75,4 +76,38 @@ grep 42 "${OUT}/out.txt" --fetch-absent install -o "${OUT2}" 2>&1 grep 42 "${OUT2}/out.txt" +# Now take the same repo, but without the subdir, to ensure we did not +# cache a wrong association. +cat > repos.json < targets/TARGETS <<'EOF' +{ "": + { "type": "generic" + , "outs": ["out.txt"] + , "cmds": ["head -c 1 src/4.txt > out.txt", "cat src/2.txt >> out.txt"] + , "deps": ["src/4.txt", "src/2.txt"] + } +} +EOF +"${JUST_MR}" --norc --local-build-root "${LBR}" \ + --remote-serve-address ${SERVE} \ + -r ${REMOTE_EXECUTION_ADDRESS} \ + --just "${JUST}" \ + --fetch-absent install -o "${OUT3}" 2>&1 +grep 42 "${OUT3}/out.txt" + echo DONE -- cgit v1.2.3