summaryrefslogtreecommitdiff
path: root/test/end-to-end/with_serve_test_runner.py
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-09-14 16:28:21 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-09-15 14:42:47 +0200
commita3824693e15fd7076f27ee17bf7fda2313d9d7ae (patch)
treebadc3095cdacb68f9d0de04aff8a94b9e4fb74dc /test/end-to-end/with_serve_test_runner.py
parent3c14ffe4648e694faadce7bd3f5e60a50413126a (diff)
downloadjustbuild-a3824693e15fd7076f27ee17bf7fda2313d9d7ae.tar.gz
Add an end-to-end test for fetching absent roots
Diffstat (limited to 'test/end-to-end/with_serve_test_runner.py')
-rwxr-xr-xtest/end-to-end/with_serve_test_runner.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/end-to-end/with_serve_test_runner.py b/test/end-to-end/with_serve_test_runner.py
index dbbd4237..b8d7de72 100755
--- a/test/end-to-end/with_serve_test_runner.py
+++ b/test/end-to-end/with_serve_test_runner.py
@@ -44,6 +44,14 @@ def dump_results() -> None:
f.write("%s\n" % (stderr, ))
+def run_cmd(cmd: List[str],
+ *,
+ env: Any = None,
+ stdout: Any = subprocess.DEVNULL,
+ stderr: Any = None,
+ cwd: str):
+ subprocess.run(cmd, cwd=cwd, env=env, stdout=stdout, stderr=stderr)
+
def get_remote_execution_address(d: Json) -> str:
return "%s:%d" % (d["interface"], int(d["port"]))
@@ -106,7 +114,7 @@ g_REMOTE_EXECUTION_ADDRESS = get_remote_execution_address(info)
SERVE_INFO = os.path.join(REMOTE_DIR, "serve-info.json")
SERVE_CONFIG_FILE = os.path.join(REMOTE_DIR, "serve.json")
-serve_config = {
+serve_config : Json = {
"local build root": SERVE_DIR,
"logging": {"limit": 6, "plain": True},
"execution endpoint": {"address": g_REMOTE_EXECUTION_ADDRESS},
@@ -139,21 +147,21 @@ for repo in os.listdir("data"):
os.path.join(DATA_DIR, repo),
target,
)
- subprocess.run(
+ run_cmd(
["git", "init"],
cwd=target,
env=dict(os.environ, **GIT_NOBODY_ENV),
stdout = subprocess.DEVNULL,
stderr = subprocess.DEVNULL,
)
- subprocess.run(
+ run_cmd(
["git", "add", "-f", "."],
cwd=target,
env=dict(os.environ, **GIT_NOBODY_ENV),
stdout = subprocess.DEVNULL,
stderr = subprocess.DEVNULL,
)
- subprocess.run(
+ run_cmd(
["git", "commit", "-m",
"Content of %s" % (target,)],
cwd=target,