From 600777262d55692769eea8a250f78f55f6baca48 Mon Sep 17 00:00:00 2001 From: William Roebuck <244554584+WilliamRoebuck@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:55:33 +0100 Subject: [PATCH] Apply fixes --- tests/utils/bazel/constants.bzl | 2 ++ tests/utils/plugins/README.md | 2 +- tests/utils/plugins/localhost.py | 2 ++ tests/utils/testing_utils/setup_test.py | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/utils/bazel/constants.bzl b/tests/utils/bazel/constants.bzl index bee69ce4..1bc3db8b 100644 --- a/tests/utils/bazel/constants.bzl +++ b/tests/utils/bazel/constants.bzl @@ -13,4 +13,6 @@ # Default installation prefix for test binaries on target systems. # Change this value to relocate all test binaries to a different base path. +# Note that if any directory other than /tmp is used, you must also use the +# --sandbox_writable_path=/your/test/path argument SCORE_TEST_INSTALL_PREFIX = "/tmp" diff --git a/tests/utils/plugins/README.md b/tests/utils/plugins/README.md index 46ebf6f2..307e5415 100644 --- a/tests/utils/plugins/README.md +++ b/tests/utils/plugins/README.md @@ -7,4 +7,4 @@ This will deploy the files into the directory `/tmp` on your host machine. So before running please create those directories with permissions so that your user can write to those directories. Note that bazel mounts the `/tmp` directory inside of the sandbox so you will -not see the files inside the `/tmp` directory. +not see the files inside the `/tmp` directory unless you use `--sandbox_add_mount_pair=/tmp`. diff --git a/tests/utils/plugins/localhost.py b/tests/utils/plugins/localhost.py index 074f6c7a..09d4e831 100644 --- a/tests/utils/plugins/localhost.py +++ b/tests/utils/plugins/localhost.py @@ -117,6 +117,8 @@ def upload(self, local_path: str, remote_path: str) -> None: dest = Path(remote_path) dest.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(local_path, dest) + # If a .tar is left over, this allows the next run to remove it + os.chmod(dest, 0o777) def download(self, remote_path: str, local_path: str) -> None: Path(local_path).parent.mkdir(parents=True, exist_ok=True) diff --git a/tests/utils/testing_utils/setup_test.py b/tests/utils/testing_utils/setup_test.py index 00618aa5..c34fdd31 100644 --- a/tests/utils/testing_utils/setup_test.py +++ b/tests/utils/testing_utils/setup_test.py @@ -25,7 +25,7 @@ def setup_test(request, target): bin_path = Path(request.config.getoption("--score-test-binary-path")) remote_dir = Path(request.config.getoption("--score-test-remote-directory")) - extract_dir = Path("/") / remote_dir.parts[1] # e.g. /tmp + extract_dir = remote_dir.parent.parent # e.g. /tmp remote_tar = extract_dir / bin_path.name res, _ = target.execute(f"mkdir -p {extract_dir}")