From b20171a41a97dbfd75a98955694eb9df5314ef27 Mon Sep 17 00:00:00 2001 From: "Klaus T. Aehlig" Date: Mon, 5 Feb 2024 11:46:34 +0100 Subject: end-to-end tests: inherit path ... for test actions, by setting an appropriate local launcher. In this way, the tests can also be run on systems where sh does not pull in enough paths to have all the "usual" tools available. --- test/end-to-end/cli/build-p.sh | 10 +++++----- test/end-to-end/cli/install.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test/end-to-end/cli') diff --git a/test/end-to-end/cli/build-p.sh b/test/end-to-end/cli/build-p.sh index 853ab3e3..9a829fe7 100644 --- a/test/end-to-end/cli/build-p.sh +++ b/test/end-to-end/cli/build-p.sh @@ -31,23 +31,23 @@ cat > TARGETS <<'EOF' } EOF -"${JUST}" build --local-build-root "${BUILDROOT}" --dump-artifacts out.json 2>&1 +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" --dump-artifacts out.json 2>&1 echo cat out.json # foo/bar is the output artifact, and it is a tree [ $(jq -rM '."foo/bar"."file_type"' out.json) = "t" ] # Therefore, foo is not an output artifact, so requesting -P leaves stdout empty -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo > foo.txt +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo > foo.txt [ -f foo.txt ] && [ -z "$(cat foo.txt)" ] # Requesting foo/bar gives a human-readable description of the tree -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar | grep baz +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar | grep baz # going deepter into the tree we stil can get human-readable tree descriptions -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting | grep hello.txt +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting | grep hello.txt # Files inside the tree can be retrieved -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting/hello.txt | grep World +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting/hello.txt | grep World echo OK diff --git a/test/end-to-end/cli/install.sh b/test/end-to-end/cli/install.sh index b3019e5b..1f06af76 100644 --- a/test/end-to-end/cli/install.sh +++ b/test/end-to-end/cli/install.sh @@ -45,7 +45,7 @@ echo # Verify non-interference of install cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" 2>&1 echo ls -al "${OUTDIR}" @@ -55,7 +55,7 @@ grep Original unrelated.txt # Verify non-interference of install cd "${SRCDIR}" -"${TOOL}" build --local-build-root "${BUILDROOT}" \ +"${TOOL}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" \ --dump-artifacts "${OUTDIR}/artifacts.json" 2>&1 echo ID=$(jq -rM '."hello.txt".id' "${OUTDIR}/artifacts.json") @@ -73,7 +73,7 @@ grep Original unrelated.txt # Verify non-interference of install (overwrite existing file with symlink) cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" @@ -86,7 +86,7 @@ grep Original unrelated.txt rm -f ${OUTDIR}/hello.txt ln -s /noexistent ${OUTDIR}/hello.txt cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" @@ -99,7 +99,7 @@ grep Original unrelated.txt rm -f ${OUTDIR}/content.txt ln -s /noexistent ${OUTDIR}/content.txt cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" -- cgit v1.2.3