From 9378421d234c5cd14d628b3454ecc35e64d4c4eb Mon Sep 17 00:00:00 2001 From: Samir Farhat Date: Fri, 27 Mar 2026 07:17:17 -0700 Subject: [PATCH] Fixed copymove to allow for alternative artifacts Summary: The copymove hook now accounts for running benchpress from alternative paths and places files undert the expected benchmark_metrics_ directory Differential Revision: D98485572 --- benchpress/plugins/hooks/copy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchpress/plugins/hooks/copy.py b/benchpress/plugins/hooks/copy.py index 3b24ad2e..a122e5f2 100644 --- a/benchpress/plugins/hooks/copy.py +++ b/benchpress/plugins/hooks/copy.py @@ -12,7 +12,7 @@ import shutil from benchpress.lib.hook import Hook -from benchpress.lib.util import get_artifacts_dir +from benchpress.lib.util import BENCHPRESS_ROOT, get_artifacts_dir logger = logging.getLogger(__name__) @@ -28,6 +28,8 @@ class CopyMoveHook(Hook): def do_copy_or_move(sources, dest, move=False): expanded_sources = [] for src in sources: + if not os.path.isabs(src): + src = os.path.join(BENCHPRESS_ROOT, src) expanded_sources.extend(glob.glob(src)) if not os.path.isdir(dest): os.mkdir(dest)