From a5ec08e347cb9f04955eee1d2e8d09684324b6cf Mon Sep 17 00:00:00 2001 From: Stuart <146047128+strtgbb@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:11:15 -0400 Subject: [PATCH] fix docker not finding the binary when specified as ./clickhouse --- helpers/cluster.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helpers/cluster.py b/helpers/cluster.py index 9f712e8b8..203a9c806 100755 --- a/helpers/cluster.py +++ b/helpers/cluster.py @@ -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 @@ -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 @@ -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 ""