Skip to content

Commit

Permalink
Merge pull request #366 from Enmk/attempt_to_fix_test_failures_on_CICD
Browse files Browse the repository at this point in the history
3.0 Attempt to fix test failures on cicd
  • Loading branch information
Enmk authored Feb 28, 2024
2 parents 1d12a3b + 856fa38 commit 5bfac6c
Show file tree
Hide file tree
Showing 5 changed files with 638 additions and 42 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ INCLUDE (subdirs)
INCLUDE (openssl)
INCLUDE (version)


OPTION (CLICKHOUSE_CPP_BUILD_BENCHMARK "Build benchmark" OFF)
OPTION (CLICKHOUSE_CPP_BUILD_TESTS "Build tests" OFF)
OPTION (CLICKHOUSE_CPP_BUILD_SHARED_LIBS "Build shared libs" OFF)
Expand All @@ -15,7 +16,8 @@ OPTION (CLICKHOUSE_CPP_WITH_SYSTEM_ABSEIL "Use system ABSEIL" OFF)
OPTION (CLICKHOUSE_CPP_WITH_SYSTEM_LZ4 "Use system LZ4" OFF)
OPTION (CLICKHOUSE_CPP_WITH_SYSTEM_CITYHASH "Use system cityhash" OFF)
OPTION (CLICKHOUSE_CPP_DEBUG_DEPENDENCIES "Print debug info about dependencies duting build" ON)
OPTION (CLICKHOUSE_CPP_CHECK_VERSION "Check that version number corresponds to git tag, usefull in CI/CD to validate that new version published on GitHub has same version in sources" ON)
OPTION (CLICKHOUSE_CPP_CHECK_VERSION "Check that version number corresponds to git tag, usefull in CI/CD to validate that new version published on GitHub has same version in sources" OFF)


PROJECT (CLICKHOUSE-CLIENT
VERSION "${CLICKHOUSE_CPP_VERSION}"
Expand Down
26 changes: 21 additions & 5 deletions clickhouse/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,30 @@ struct ClientInfo {
uint32_t client_revision = 0;
};

std::ostream& operator<<(std::ostream& os, const Endpoint& endpoint) {
return os << endpoint.host << ":" << endpoint.port;
}

std::ostream& operator<<(std::ostream& os, const ClientOptions& opt) {
os << "Client(" << opt.user << '@' << opt.host << ":" << opt.port
<< "Endpoints :";
for (size_t i = 0; i < opt.endpoints.size(); i++)
os << opt.user << '@' << opt.endpoints[i].host << ":" << opt.endpoints[i].port
os << "Client("
<< " Endpoints : [";
size_t extra_endpoints = 0;

if (!opt.host.empty()) {
extra_endpoints = 1;
os << opt.user << '@' << Endpoint{opt.host, opt.port};

if (opt.endpoints.size())
os << ", ";
}

for (size_t i = 0; i < opt.endpoints.size(); i++) {
os << opt.user << '@' << opt.endpoints[i]
<< ((i == opt.endpoints.size() - 1) ? "" : ", ");
}

os << " ping_before_query:" << opt.ping_before_query
os << "] (" << opt.endpoints.size() + extra_endpoints << " items )"
<< " ping_before_query:" << opt.ping_before_query
<< " send_retries:" << opt.send_retries
<< " retry_timeout:" << opt.retry_timeout.count()
<< " compression_method:"
Expand Down
1 change: 1 addition & 0 deletions clickhouse/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct ClientOptions {
};

std::ostream& operator<<(std::ostream& os, const ClientOptions& options);
std::ostream& operator<<(std::ostream& os, const Endpoint& options);

class SocketFactory;

Expand Down
Loading

0 comments on commit 5bfac6c

Please sign in to comment.