diff --git a/tests/integration/test_fetch_part_from_auxiliary_zookeeper/__init__.py b/tests/integration/test_fetch_part_from_auxiliary_zookeeper/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/integration/test_fetch_part_from_auxiliary_zookeeper/configs/zookeeper_config.xml b/tests/integration/test_fetch_part_from_auxiliary_zookeeper/configs/zookeeper_config.xml deleted file mode 100644 index b2b0667ebbf..00000000000 --- a/tests/integration/test_fetch_part_from_auxiliary_zookeeper/configs/zookeeper_config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - zoo1 - 2181 - - - zoo2 - 2181 - - - zoo3 - 2181 - - - - - - zoo1 - 2181 - - - zoo2 - 2181 - - - - diff --git a/tests/integration/test_fetch_part_from_auxiliary_zookeeper/test.py b/tests/integration/test_fetch_part_from_auxiliary_zookeeper/test.py deleted file mode 100644 index 17617f1c45c..00000000000 --- a/tests/integration/test_fetch_part_from_auxiliary_zookeeper/test.py +++ /dev/null @@ -1,40 +0,0 @@ - - -import pytest -from helpers.client import QueryRuntimeException -from helpers.cluster import ClickHouseCluster - -cluster = ClickHouseCluster(__file__) -node = cluster.add_instance("node", main_configs=["configs/zookeeper_config.xml"], with_zookeeper=True) - - -@pytest.fixture(scope="module") -def start_cluster(): - try: - cluster.start() - - yield cluster - finally: - cluster.shutdown() - - -def test_fetch_part_from_allowed_zookeeper(start_cluster): - node.query( - "CREATE TABLE simple (date Date, id UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/0/simple', 'node') ORDER BY tuple() PARTITION BY date;" - ) - node.query("INSERT INTO simple VALUES ('2020-08-27', 1)") - - node.query( - "CREATE TABLE simple2 (date Date, id UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/1/simple', 'node') ORDER BY tuple() PARTITION BY date;" - ) - node.query( - "ALTER TABLE simple2 FETCH PART '20200827_0_0_0' FROM 'zookeeper2:/clickhouse/tables/0/simple';" - ) - node.query("ALTER TABLE simple2 ATTACH PART '20200827_0_0_0';") - - with pytest.raises(QueryRuntimeException): - node.query( - "ALTER TABLE simple2 FETCH PART '20200827_0_0_0' FROM 'zookeeper:/clickhouse/tables/0/simple';" - ) - - assert node.query("SELECT id FROM simple2").strip() == "1" diff --git a/tests/integration/test_fetch_partition_from_auxiliary_zookeeper/test.py b/tests/integration/test_fetch_partition_from_auxiliary_zookeeper/test.py index 0c94dfd3c48..d8d240349fc 100644 --- a/tests/integration/test_fetch_partition_from_auxiliary_zookeeper/test.py +++ b/tests/integration/test_fetch_partition_from_auxiliary_zookeeper/test.py @@ -18,7 +18,14 @@ def start_cluster(): cluster.shutdown() -def test_fetch_partition_from_allowed_zookeeper(start_cluster): +@pytest.mark.parametrize( + ('part', 'part_name'), + [ + ('PARTITION', '2020-08-27'), + ('PART', '20200827_0_0_0'), + ] +) +def test_fetch_part_from_allowed_zookeeper(start_cluster, part, part_name): node.query( "CREATE TABLE simple (date Date, id UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/0/simple', 'node') ORDER BY tuple() PARTITION BY date;" ) @@ -27,14 +34,17 @@ def test_fetch_partition_from_allowed_zookeeper(start_cluster): node.query( "CREATE TABLE simple2 (date Date, id UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/1/simple', 'node') ORDER BY tuple() PARTITION BY date;" ) + node.query( - "ALTER TABLE simple2 FETCH PARTITION '2020-08-27' FROM 'zookeeper2:/clickhouse/tables/0/simple';" - ) - node.query("ALTER TABLE simple2 ATTACH PARTITION '2020-08-27';") + """ALTER TABLE simple2 FETCH {part} '{part_name}' FROM 'zookeeper2:/clickhouse/tables/0/simple';""".format( + part=part, part_name=part_name)) + + node.query("""ALTER TABLE simple2 ATTACH {part} '{part_name}';""".format( + part=part, part_name=part_name)) with pytest.raises(QueryRuntimeException): node.query( - "ALTER TABLE simple2 FETCH PARTITION '2020-08-27' FROM 'zookeeper:/clickhouse/tables/0/simple';" - ) + """ALTER TABLE simple2 FETCH {part} '{part_name}' FROM 'zookeeper:/clickhouse/tables/0/simple';""".format( + part=part, part_name=part_name)) assert node.query("SELECT id FROM simple2").strip() == "1"