fix test benchmark

With newer versions of git we need to add an exception
for the `workdir` which is owned by a different user
then the one that is running the git commands.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
This commit is contained in:
Andreea Florescu
2022-09-08 10:26:52 +02:00
committed by Laura Loghin
parent 258161e88a
commit 1401badaaf
+6
View File
@@ -34,6 +34,12 @@ def test_bench():
"""Runs benchmarks before and after and compares the results."""
os.chdir(get_repo_root_path())
# Newer versions of git check the ownership of directories.
# We need to add an exception for /workdir which is shared, so that
# the git commands don't fail.
config_cmd = "git config --global --add safe.directory /workdir"
subprocess.run(config_cmd, shell=True, check=True)
# Get numbers for current HEAD.
return_code, stdout, stderr = _run_cargo_bench(PR_BENCH_RESULTS_FILE)
# Even if it is the first time this test is run, the benchmark tests should