diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-21 09:53:13 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-21 11:06:11 +0100 |
commit | 5700e20a3c8321b70270a21579fcc15f5bbc1db2 (patch) | |
tree | 41e3446b9c64f90a130100c451e671ee8cdd1d40 /test/end-to-end/tree-structure | |
parent | be8a6c25dea7bfa878edd0dd33606ecdcb716ded (diff) | |
download | justbuild-5700e20a3c8321b70270a21579fcc15f5bbc1db2.tar.gz |
Test: Compute an absent tree structure of a local root
Diffstat (limited to 'test/end-to-end/tree-structure')
-rw-r--r-- | test/end-to-end/tree-structure/absent_tree_structure.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/end-to-end/tree-structure/absent_tree_structure.sh b/test/end-to-end/tree-structure/absent_tree_structure.sh index c7ab70e9..24e9498d 100644 --- a/test/end-to-end/tree-structure/absent_tree_structure.sh +++ b/test/end-to-end/tree-structure/absent_tree_structure.sh @@ -28,6 +28,13 @@ if [ "${COMPATIBLE:-}" = "YES" ]; then COMPAT="--compatible" fi +readonly LOCAL_REPO="${ROOT}/local" +mkdir -p "${LOCAL_REPO}/src/foo/nested_foo" +echo foo > "${LOCAL_REPO}/src/foo/nested_foo/file.txt" + +mkdir -p "${LOCAL_REPO}/src/bar/nested_bar" +echo bar > "${LOCAL_REPO}/src/bar/nested_bar/file.txt" + readonly MAIN_REPO="${ROOT}/main" mkdir -p "${MAIN_REPO}" cd "${MAIN_REPO}" @@ -91,6 +98,23 @@ cat > repo-config.json <<EOF { "repository": "structure_bar" , "target_root": "targets" } + , "local": + { "repository": + { "type": "file" + , "path": "${LOCAL_REPO}" + , "pragma": { "to_git": true } + } + } + , "structure_local": + { "repository": + { "type": "tree structure" + , "repo": "local" + } + } + , "result_local": + { "repository": "structure_local" + , "target_root": "targets" + } } } EOF @@ -180,4 +204,29 @@ grep 'Root \["tree structure", "bar"\] has been taken from local cache' \ echo cat "${OUT}/result_bar/result.txt" +# Test absent tree structure root of a local root. +# Set only tree structure absent: +cat > absent.json <<'EOF' +["structure_local"] +EOF + +echo +echo "Absent tree structure root of a local root." +echo "Expected to be computed locally and uploaded to serve:" +("${JUST_MR}" --rc "${RCFILE}" \ + --local-build-root "${LBRDIR}/absent_local" -C repo-config.json \ + -r "${REMOTE_EXECUTION_ADDRESS}" -R "${SERVE}" ${COMPAT} \ + --main result_local -L '["env", "PATH='"${PATH}"'"]' --log-limit 4 \ + --just "${JUST}" install -o "${OUT}/absent_local" 2>&1) \ + > "${OUT}/log_absent_local" + +echo +cat "${OUT}/log_absent_local" + +grep 'Root \["tree structure", "local", {"absent": true}\] was computed locally and uploaded to serve' \ + "${OUT}/log_absent_local" + +echo +cat "${OUT}/absent_local/result.txt" + echo OK |