ClickHouse/tests/integration/test_shard_level_const_function/test.py

31 lines
739 B
Python
Raw Normal View History

2021-07-30 09:23:49 +00:00
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance(
"node1", main_configs=["configs/remote_servers.xml"], with_zookeeper=True
)
node2 = cluster.add_instance(
"node2", main_configs=["configs/remote_servers.xml"], with_zookeeper=True
)
@pytest.fixture(scope="module")
def start_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
def test_remote(start_cluster):
assert (
node1.query(
2021-07-31 15:00:10 +00:00
"""select hostName() h, tcpPort() p, count() from clusterAllReplicas("two_shards", system.one) group by h, p order by h, p"""
2021-07-30 09:23:49 +00:00
)
== "node1\t9000\t1\nnode2\t9000\t1\n"
)