diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-12-19 15:05:11 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-01-10 12:47:02 +0100 |
commit | 36262967d1cd2a154ec74c56ee3bc6126aa674c2 (patch) | |
tree | 08449d4ee8ea0ab0f1788ca6a2662dcc54838b30 /test | |
parent | 2380a554acf987160dd0dcfee31ac5b8d91eebfa (diff) | |
download | justbuild-36262967d1cd2a154ec74c56ee3bc6126aa674c2.tar.gz |
just-lock tests: Give the local build root to the tool
This avoids the tool accidentally trying to touch the home folder
via the default cache location.
While there, ensure that errors in just-lock calls trigger test
failures, as it should be.
Diffstat (limited to 'test')
-rw-r--r-- | test/end-to-end/just-lock/absent.sh | 5 | ||||
-rw-r--r-- | test/end-to-end/just-lock/computed.sh | 14 | ||||
-rwxr-xr-x | test/end-to-end/just-lock/deduplicate.sh | 12 | ||||
-rw-r--r-- | test/end-to-end/just-lock/file-imports.sh | 3 | ||||
-rw-r--r-- | test/end-to-end/just-lock/git-imports.sh | 3 |
5 files changed, 27 insertions, 10 deletions
diff --git a/test/end-to-end/just-lock/absent.sh b/test/end-to-end/just-lock/absent.sh index 9539f8b8..d01a3f32 100644 --- a/test/end-to-end/just-lock/absent.sh +++ b/test/end-to-end/just-lock/absent.sh @@ -17,6 +17,7 @@ set -eu readonly JUST_LOCK="${PWD}/bin/lock-tool-under-test" +readonly LBR="${TEST_TMPDIR}/local-build-root" readonly REPO_DIRS="${TEST_TMPDIR}/repos" readonly WRKDIR="${PWD}" @@ -85,7 +86,9 @@ cat > repos.in.json <<EOF ] } EOF -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 +echo cat repos.json echo diff --git a/test/end-to-end/just-lock/computed.sh b/test/end-to-end/just-lock/computed.sh index 79e21fe3..7a11d466 100644 --- a/test/end-to-end/just-lock/computed.sh +++ b/test/end-to-end/just-lock/computed.sh @@ -98,8 +98,11 @@ cat > repos.in.json <<EOF } EOF -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 +echo cat repos.json +echo cat > generate.py <<'EOF' import json @@ -198,14 +201,17 @@ cat > repos.in.json <<EOF ] } EOF -"${JUST_LOCK}" -C repos.in.json -o repos.json - +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 echo cat repos.json -grep DoNotImport && exit 1 || : # we should not bring in unneeded bindings echo + +grep DoNotImport && exit 1 || : # we should not bring in unneeded bindings + "${JUST_MR}" -C repos.json --norc --just "${JUST}" \ --local-build-root "${LBR}" analyse \ -L '["env", "PATH='"${PATH}"'"]' 2>&1 +echo echo "OK" diff --git a/test/end-to-end/just-lock/deduplicate.sh b/test/end-to-end/just-lock/deduplicate.sh index 4977db78..a67e7977 100755 --- a/test/end-to-end/just-lock/deduplicate.sh +++ b/test/end-to-end/just-lock/deduplicate.sh @@ -59,7 +59,9 @@ cat > repos.in.json <<EOF ] } EOF -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 +echo cat repos.json echo cat > TARGETS <<'EOF' @@ -114,7 +116,9 @@ cat > repos.in.json <<EOF , "keep": ["foo", "bar/foo"] } EOF -"${JUST_LOCK}" -C repos.in.json -o repos-keep.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos-keep.json --local-build-root "${LBR}" 2>&1 +echo cat repos-keep.json echo "${JUST_MR}" -C repos-keep.json --norc --just "${JUST}" \ @@ -144,7 +148,9 @@ cat > repos.in.json <<EOF ] } EOF -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 +echo cat repos.json echo "${JUST_MR}" -C repos.json --norc --just "${JUST}" \ diff --git a/test/end-to-end/just-lock/file-imports.sh b/test/end-to-end/just-lock/file-imports.sh index bc706286..b20de5c7 100644 --- a/test/end-to-end/just-lock/file-imports.sh +++ b/test/end-to-end/just-lock/file-imports.sh @@ -79,7 +79,8 @@ EOF echo cat repos.in.json -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 cat repos.json echo "${JUST_MR}" -L '["env", "PATH='"${PATH}"'"]' --norc --just "${JUST}" --local-build-root "${LBR}" install -o "${OUT}" 2>&1 diff --git a/test/end-to-end/just-lock/git-imports.sh b/test/end-to-end/just-lock/git-imports.sh index aa29ba6c..f808bb79 100644 --- a/test/end-to-end/just-lock/git-imports.sh +++ b/test/end-to-end/just-lock/git-imports.sh @@ -92,7 +92,8 @@ EOF echo cat repos.in.json -"${JUST_LOCK}" -C repos.in.json -o repos.json +echo +"${JUST_LOCK}" -C repos.in.json -o repos.json --local-build-root "${LBR}" 2>&1 echo cat repos.json |