From 212241789d6fb433f758246a966822d54a75925f Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 17 Oct 2024 10:15:50 +0100 Subject: [PATCH] fix: have benchmark test clean working directory Before checking out different commits, clean the working directory to avoid checkout failures to to temporary files created during benchmark execution (as is done by linux-loader) Signed-off-by: Patrick Roy --- integration_tests/test_benchmark.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration_tests/test_benchmark.py b/integration_tests/test_benchmark.py index 6b86de3..5907ef6 100644 --- a/integration_tests/test_benchmark.py +++ b/integration_tests/test_benchmark.py @@ -101,14 +101,21 @@ def _run_critcmp(): print(p.stderr.decode("utf-8")) +def _clean_workdir(): + subprocess.run("git restore .", shell=True, check=True) + subprocess.run("git clean -fd", shell=True, check=True) + + def _git_checkout_upstream_branch(): subprocess.run( "git fetch {} {}".format(REMOTE, BASE_BRANCH), shell=True, check=True ) + _clean_workdir() subprocess.run("git checkout FETCH_HEAD", shell=True, check=True) def _git_checkout_pr_branch(): + _clean_workdir() subprocess.run( "git checkout -", shell=True,