From 1401badaafd0ac472775d38a8d9e3ed53f6231ce Mon Sep 17 00:00:00 2001 From: Andreea Florescu Date: Thu, 8 Sep 2022 10:26:52 +0200 Subject: [PATCH] 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 --- integration_tests/test_benchmark.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integration_tests/test_benchmark.py b/integration_tests/test_benchmark.py index 5e375a0..4fe0fd6 100644 --- a/integration_tests/test_benchmark.py +++ b/integration_tests/test_benchmark.py @@ -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