Skip to content

Commit 55da57c

Browse files
[fix] Fixed git extraction of info within any git path (#43)
* [fix] Fixed git extraction of info within any git path
1 parent 5130d91 commit 55da57c

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.1.42"
3+
version = "0.1.43"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run_local/run_local.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import yaml
1111

12-
from redisbench_admin.run.run import redis_benchmark_ensure_min_version
1312
from redisbench_admin.run.redis_benchmark.redis_benchmark import prepareRedisBenchmarkCommand, \
1413
redis_benchmark_from_stdout_csv_to_json
14+
from redisbench_admin.run.run import redis_benchmark_ensure_min_version
1515
from redisbench_admin.utils.local import (
1616
spinUpLocalRedis,
1717
getLocalRunFullFilename,
@@ -111,7 +111,9 @@ def run_local_command_logic(args):
111111
raise Exception("Unable to detect benchmark tool within 'clientconfig' section. Aborting...")
112112

113113
if benchmark_tool not in args.allowed_tools.split(","):
114-
raise Exception("Benchmark tool {} not in the allowed tools list [{}]. Aborting...".format(benchmark_tool,args.allowed_tools))
114+
raise Exception(
115+
"Benchmark tool {} not in the allowed tools list [{}]. Aborting...".format(benchmark_tool,
116+
args.allowed_tools))
115117

116118
if benchmark_min_tool_version is not None and benchmark_tool == "redis-benchmark":
117119
redis_benchmark_ensure_min_version(benchmark_tool, benchmark_min_tool_version,

redisbench_admin/utils/remote.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
from tqdm import tqdm
1616

1717

18+
def get_git_root(path):
19+
git_repo = git.Repo(path, search_parent_directories=True)
20+
git_root = git_repo.git.rev_parse("--show-toplevel")
21+
return git_root
22+
1823
def viewBarSimple(a, b):
1924
res = a / int(b) * 100
2025
sys.stdout.write("\r Complete precent: %.2f %%" % (res))
@@ -149,7 +154,7 @@ def setupRemoteEnviroment(
149154
client_public_ip,
150155
)
151156

152-
def extract_git_vars(path=os.getcwd()):
157+
def extract_git_vars(path=get_git_root(".")):
153158
github_repo = Repo(path)
154159
github_url = github_repo.remotes[0].config_reader.get("url")
155160
github_org_name = github_url.split("/")[-2]

0 commit comments

Comments
 (0)