diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-09-14 16:28:21 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-09-15 14:42:47 +0200 |
commit | a3824693e15fd7076f27ee17bf7fda2313d9d7ae (patch) | |
tree | badc3095cdacb68f9d0de04aff8a94b9e4fb74dc /test/end-to-end/with_serve_test_runner.py | |
parent | 3c14ffe4648e694faadce7bd3f5e60a50413126a (diff) | |
download | justbuild-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-x | test/end-to-end/with_serve_test_runner.py | 16 |
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, |