Skip to content

Commit

Permalink
Exclude scratch folder when clean multitest runpath.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxuan-ms committed Jun 27, 2024
1 parent 0ff900a commit 0a4ba7c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion testplan/common/utils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,16 @@ def clean_runpath_if_passed(
"""
multitest = env.parent
if multitest.report.passed:
shutil.rmtree(multitest.runpath, ignore_errors=True)
for subfile in os.listdir(multitest.runpath):
# TODO: Define scratch as a constant
if subfile != "scratch":
path = os.path.join(
os.path.abspath(multitest.runpath), subfile
)
if os.path.isfile(path) or os.path.islink(path):
os.remove(path)
elif os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)


@testsuite
Expand Down

0 comments on commit 0a4ba7c

Please sign in to comment.