Skip to content

Commit

Permalink
fix: have benchmark test clean working directory
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roypat authored and ShadowCurse committed Oct 17, 2024
1 parent 209c04e commit 2122417
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integration_tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2122417

Please sign in to comment.