Skip to content

Commit 52722d2

Browse files
committed
update benchmark
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent d74e3c9 commit 52722d2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.mise/tasks/run_benchmarks.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,18 @@ def main(argv: List[str]):
166166
parser.add_argument('--jmh-args', default='', help='Extra arguments to pass to the JMH main (e.g. "-f 1 -wi 0 -i 1")')
167167
args = parser.parse_args(argv)
168168

169-
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
169+
# Determine repository root by searching upwards for a marker (mvnw or pom.xml).
170+
start_dir = os.path.abspath(os.path.dirname(__file__))
171+
repo_root = start_dir
172+
while True:
173+
if os.path.exists(os.path.join(repo_root, 'mvnw')) or os.path.exists(os.path.join(repo_root, 'pom.xml')):
174+
break
175+
parent = os.path.dirname(repo_root)
176+
if parent == repo_root:
177+
# reached filesystem root; fallback to original heuristic (one level up)
178+
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
179+
break
180+
repo_root = parent
170181
os.chdir(repo_root)
171182

172183
build_benchmarks(args.mvnw, args.module)

0 commit comments

Comments
 (0)