summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-02 12:06:21 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-02 17:20:35 +0100
commit5ec10bf23e299433ad540a22de37669b009ad1ad (patch)
tree92efd3ad393ebdb51c18017ff673b328ccfc96ce
parentfcb5f8625c8b872497c88cc23f169926d691e308 (diff)
downloadjustbuild-5ec10bf23e299433ad540a22de37669b009ad1ad.tar.gz
["end-to-end", "with remote"]: support REMOTE_BIN
For tests where we bring our own remote-execution end point, support a directory where executables can be placed that are picked up early in PATH by remote actions. In this way, a test can be designed verifying that a particular action actually was run remotely.
-rw-r--r--test/end-to-end/RULES2
-rwxr-xr-xtest/end-to-end/with_remote_test_runner.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/test/end-to-end/RULES b/test/end-to-end/RULES
index 93a63c9e..c02f9f24 100644
--- a/test/end-to-end/RULES
+++ b/test/end-to-end/RULES
@@ -25,6 +25,8 @@
, " implicit remote-execution endpoint is listening at."
, " - COMPATIBLE is set to an non-empty string, if the server was"
, " started in compatible mode, and unset otherwise."
+ , " - REMOTE_BIN specifying an extra directory added to remote-execution"
+ , " actions early in path."
, "Additionally, the variables TLS_CA_CERT, TLS_CLIENT_CERT, and"
, "TLS_CLIENT_KEY are removed from the environment."
, ""
diff --git a/test/end-to-end/with_remote_test_runner.py b/test/end-to-end/with_remote_test_runner.py
index ea1121bc..9f817273 100755
--- a/test/end-to-end/with_remote_test_runner.py
+++ b/test/end-to-end/with_remote_test_runner.py
@@ -60,6 +60,8 @@ os.makedirs(WORK_DIR, exist_ok=True)
REMOTE_DIR = os.path.realpath("remote")
os.makedirs(REMOTE_DIR, exist_ok=True)
REMOTE_LBR = os.path.join(REMOTE_DIR, "build-root")
+REMOTE_EXTRA_BINDIR = os.path.join(REMOTE_DIR, "bin")
+os.makedirs(REMOTE_EXTRA_BINDIR, exist_ok=True)
g_REMOTE_EXECUTION_ADDRESS: str = ""
@@ -85,7 +87,9 @@ if not custom_remote:
"./staged/bin/just",
"execute",
"-L",
- json.dumps(["env", "PATH=" + PATH]),
+ json.dumps(
+ ["env",
+ "PATH=" + REMOTE_EXTRA_BINDIR + (":" if PATH else "") + PATH]),
"--info-file",
REMOTE_INFO,
"--local-build-root",
@@ -135,7 +139,8 @@ else:
ENV = dict(os.environ,
TEST_TMPDIR=TEMP_DIR,
TMPDIR=TEMP_DIR,
- REMOTE_EXECUTION_ADDRESS=g_REMOTE_EXECUTION_ADDRESS)
+ REMOTE_EXECUTION_ADDRESS=g_REMOTE_EXECUTION_ADDRESS,
+ REMOTE_BIN=REMOTE_EXTRA_BINDIR)
if compatible:
ENV["COMPATIBLE"] = "YES"