Skip to content

Commit 2122417

Browse files
roypatShadowCurse
authored andcommitted
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 <[email protected]>
1 parent 209c04e commit 2122417

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

integration_tests/test_benchmark.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,21 @@ def _run_critcmp():
101101
print(p.stderr.decode("utf-8"))
102102

103103

104+
def _clean_workdir():
105+
subprocess.run("git restore .", shell=True, check=True)
106+
subprocess.run("git clean -fd", shell=True, check=True)
107+
108+
104109
def _git_checkout_upstream_branch():
105110
subprocess.run(
106111
"git fetch {} {}".format(REMOTE, BASE_BRANCH), shell=True, check=True
107112
)
113+
_clean_workdir()
108114
subprocess.run("git checkout FETCH_HEAD", shell=True, check=True)
109115

110116

111117
def _git_checkout_pr_branch():
118+
_clean_workdir()
112119
subprocess.run(
113120
"git checkout -",
114121
shell=True,

0 commit comments

Comments
 (0)