summaryrefslogtreecommitdiff
path: root/test/end-to-end/serve-service
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-15 17:05:21 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-20 17:06:36 +0100
commitdc8354a74dbec2a6dbde23e4b245676a1a842880 (patch)
tree67aa6a964d81dcfecc14cd98cd46efe139cfc654 /test/end-to-end/serve-service
parent1ea25cc86133e1e54a8eb10bdd4aa714fa4a187d (diff)
downloadjustbuild-dc8354a74dbec2a6dbde23e4b245676a1a842880.tar.gz
Test "serve-query-target-cache-value": adaopt to standalone
This test tries to demonstrate that even if the remote-execution has forgotten the action, the target-level cache of just serve will allow a successful build without repeating the action. It does it by cleaning the local build root of the remote-execution service. If, however, serve and execute are the same process, they also use the same local build root, so the target-level cache entry needs to be kept alive separately.
Diffstat (limited to 'test/end-to-end/serve-service')
-rw-r--r--test/end-to-end/serve-service/serve_query_target_cache_value.sh27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/end-to-end/serve-service/serve_query_target_cache_value.sh b/test/end-to-end/serve-service/serve_query_target_cache_value.sh
index 9a09ec47..54e68d51 100644
--- a/test/end-to-end/serve-service/serve_query_target_cache_value.sh
+++ b/test/end-to-end/serve-service/serve_query_target_cache_value.sh
@@ -25,6 +25,8 @@ env
readonly JUST="${PWD}/bin/tool-under-test"
readonly JUST_MR="${PWD}/bin/mr-tool-under-test"
readonly LBR="${TEST_TMPDIR}/local-build-root"
+readonly LBR_UNRELATED_A="${TEST_TMPDIR}/local-build-root-unrelated-A"
+readonly LBR_UNRELATED_B="${TEST_TMPDIR}/local-build-root-unrelated-B"
readonly TOOLS_DIR="${TEST_TMPDIR}/tools"
readonly OUT="${TEST_TMPDIR}/out"
@@ -93,16 +95,15 @@ cat "${CONF}"
echo
"${JUST}" build \
- --local-build-root "${SERVE_LBR}" \
+ --local-build-root "${LBR_UNRELATED_A}" \
-C "${CONF}" \
+ --remote-serve-address "${SERVE}" \
-r "${REMOTE_EXECUTION_ADDRESS}" \
${COMPAT} \
${REMOTE_PROPERTIES} \
${DISPATCH} \
-D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' 2>&1
-ls -R "${SERVE_LBR}"
-
# Demonstrate that from now on, we don't build anything any more
rm -rf "${TOOLS_DIR}"
@@ -127,7 +128,25 @@ echo "failed as expected"
# Demonstrate we cannot build with a clean remote CAS
"${JUST}" gc --local-build-root ${REMOTE_LBR} 2>&1
+if [ -n "${STANDALONE_SERVE:-}" ]
+then
+ # if serve and remote-execution are the same process
+ # they also use the same local build root; in this case,
+ # we need to keep the target-level cache of the serve
+ # process alive
+ echo "Building with serve again, to keep tc cache alive"
+ "${JUST}" build \
+ --local-build-root "${LBR_UNRELATED_B}" \
+ -C "${CONF}" \
+ --remote-serve-address "${SERVE}" \
+ -r "${REMOTE_EXECUTION_ADDRESS}" \
+ ${COMPAT} \
+ ${REMOTE_PROPERTIES} \
+ ${DISPATCH} \
+ -D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' 2>&1
+fi
"${JUST}" gc --local-build-root ${REMOTE_LBR} 2>&1
+echo
"${JUST}" build \
--local-build-root "${LBR}" \
@@ -136,7 +155,7 @@ echo "failed as expected"
${COMPAT} \
${REMOTE_PROPERTIES} \
${DISPATCH} \
- -D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' 2>&1 && echo "this should fail" && exit 1q
+ -D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' 2>&1 && echo "this should fail" && exit 1
echo "failed as expected"
# Demonstrate that we can build if serve endpoint provides the target cache value