Skip to content

Commit

Permalink
fix docker not finding the binary when specified as ./clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
strtgbb committed Oct 4, 2024
1 parent 8c86040 commit a5ec08e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helpers/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ def __init__(self, source, program_name="clickhouse"):
self.binary_path = source

if self.binary_path:
self.binary_path = os.path.abspath(self.binary_path)
with Shell() as bash:
if os.path.relpath(self.binary_path).startswith("../.."):
# Binary is outside of the build context, move it to where docker can find it
Expand Down Expand Up @@ -1867,7 +1868,8 @@ def up(self, timeout=30 * 60):
self.environ["COMPOSE_HTTP_TIMEOUT"] = "600"
assert self.clickhouse_binary_path
self.environ["CLICKHOUSE_TESTS_SERVER_BIN_PATH"] = (
self.clickhouse_binary_path
# To work with the dockerfiles, the path must be relative to the docker-compose directory
os.path.relpath(self.clickhouse_binary_path, current_dir())
)
self.environ["CLICKHOUSE_TESTS_ODBC_BRIDGE_BIN_PATH"] = (
self.clickhouse_odbc_bridge_binary_path
Expand All @@ -1877,7 +1879,9 @@ def up(self, timeout=30 * 60):
)
)
self.environ["CLICKHOUSE_TESTS_KEEPER_BIN_PATH"] = (
self.keeper_binary_path or ""
""
if not self.keeper_binary_path
else os.path.relpath(self.keeper_binary_path, current_dir())
)
self.environ["CLICKHOUSE_TESTS_ZOOKEEPER_VERSION"] = (
self.zookeeper_version or ""
Expand Down

0 comments on commit a5ec08e

Please sign in to comment.