mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
better test cases names
This commit is contained in:
parent
c3c409556e
commit
8f53d1344c
@ -60,10 +60,10 @@ def started_cluster():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("clickhouse,name,layout", [
|
||||
(node1, 'complex_node1_hashed', 'LAYOUT(COMPLEX_KEY_HASHED())'),
|
||||
(node1, 'complex_node1_cache', 'LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10))'),
|
||||
(node2, 'complex_node2_hashed', 'LAYOUT(COMPLEX_KEY_HASHED())'),
|
||||
(node2, 'complex_node2_cache', 'LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10))'),
|
||||
pytest.param(node1, 'complex_node1_hashed', 'LAYOUT(COMPLEX_KEY_HASHED())', id="complex_node1_hashed"),
|
||||
pytest.param(node1, 'complex_node1_cache', 'LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10))', id="complex_node1_cache"),
|
||||
pytest.param(node2, 'complex_node2_hashed', 'LAYOUT(COMPLEX_KEY_HASHED())', id="complex_node2_hashed"),
|
||||
pytest.param(node2, 'complex_node2_cache', 'LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10))', id="complex_node2_cache"),
|
||||
])
|
||||
def test_create_and_select_mysql(started_cluster, clickhouse, name, layout):
|
||||
mysql_conn = create_mysql_conn("root", "clickhouse", started_cluster.mysql_ip, started_cluster.mysql_port)
|
||||
|
@ -2,7 +2,6 @@
|
||||
# (just in case, with real separate instances).
|
||||
|
||||
|
||||
|
||||
import pytest
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
|
||||
@ -51,9 +50,13 @@ def started_cluster():
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("node", list(NODES.values()))
|
||||
@pytest.mark.parametrize("source",
|
||||
["distributed_over_distributed_table", "cluster('test_cluster', default, distributed_table)"])
|
||||
@pytest.mark.parametrize("node,source", [
|
||||
pytest.param(NODES["node1"], "distributed_over_distributed_table", id="dod_node1"),
|
||||
pytest.param(NODES["node1"], "cluster('test_cluster', default, distributed_table)", id="cluster_node1"),
|
||||
pytest.param(NODES["node2"], "distributed_over_distributed_table", id="dod_node2"),
|
||||
pytest.param(NODES["node2"], "cluster('test_cluster', default, distributed_table)", id="cluster_node2"),
|
||||
]
|
||||
)
|
||||
class TestDistributedOverDistributedSuite:
|
||||
def test_select_with_order_by_node(self, started_cluster, node, source):
|
||||
assert node.query("SELECT * FROM {source} ORDER BY node, key".format(source=source)) \
|
||||
|
@ -290,8 +290,8 @@ def test_query_parser(start_cluster):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("test_alter_policy", "MergeTree()"),
|
||||
("replicated_test_alter_policy", "ReplicatedMergeTree('/clickhouse/test_alter_policy', '1')",),
|
||||
pytest.param("test_alter_policy", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_test_alter_policy", "ReplicatedMergeTree('/clickhouse/test_alter_policy', '1')", id="replicated"),
|
||||
])
|
||||
def test_alter_policy(start_cluster, name, engine):
|
||||
try:
|
||||
@ -364,8 +364,8 @@ def test_no_warning_about_zero_max_data_part_size(start_cluster):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_on_jbod", "MergeTree()"),
|
||||
("replicated_mt_on_jbod", "ReplicatedMergeTree('/clickhouse/replicated_mt_on_jbod', '1')",),
|
||||
pytest.param("mt_on_jbod", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_mt_on_jbod", "ReplicatedMergeTree('/clickhouse/replicated_mt_on_jbod', '1')", id="replicated"),
|
||||
])
|
||||
def test_round_robin(start_cluster, name, engine):
|
||||
try:
|
||||
@ -400,8 +400,8 @@ def test_round_robin(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_with_huge_part", "MergeTree()"),
|
||||
("replicated_mt_with_huge_part", "ReplicatedMergeTree('/clickhouse/replicated_mt_with_huge_part', '1')",),
|
||||
pytest.param("mt_with_huge_part", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_mt_with_huge_part", "ReplicatedMergeTree('/clickhouse/replicated_mt_with_huge_part', '1')", id="replicated"),
|
||||
])
|
||||
def test_max_data_part_size(start_cluster, name, engine):
|
||||
try:
|
||||
@ -427,8 +427,8 @@ def test_max_data_part_size(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_with_overflow", "MergeTree()"),
|
||||
("replicated_mt_with_overflow", "ReplicatedMergeTree('/clickhouse/replicated_mt_with_overflow', '1')",),
|
||||
pytest.param("mt_with_overflow", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_mt_with_overflow", "ReplicatedMergeTree('/clickhouse/replicated_mt_with_overflow', '1')", id="replicated"),
|
||||
])
|
||||
def test_jbod_overflow(start_cluster, name, engine):
|
||||
try:
|
||||
@ -480,8 +480,8 @@ def test_jbod_overflow(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("moving_mt", "MergeTree()"),
|
||||
("moving_replicated_mt", "ReplicatedMergeTree('/clickhouse/moving_replicated_mt', '1')",),
|
||||
pytest.param("moving_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("moving_replicated_mt", "ReplicatedMergeTree('/clickhouse/moving_replicated_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_background_move(start_cluster, name, engine):
|
||||
try:
|
||||
@ -530,8 +530,8 @@ def test_background_move(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("stopped_moving_mt", "MergeTree()"),
|
||||
("stopped_moving_replicated_mt", "ReplicatedMergeTree('/clickhouse/stopped_moving_replicated_mt', '1')",),
|
||||
pytest.param("stopped_moving_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("stopped_moving_replicated_mt", "ReplicatedMergeTree('/clickhouse/stopped_moving_replicated_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_start_stop_moves(start_cluster, name, engine):
|
||||
try:
|
||||
@ -633,7 +633,7 @@ def get_paths_for_partition_from_part_log(node, table, partition_id):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("altering_mt", "MergeTree()"),
|
||||
pytest.param("altering_mt", "MergeTree()", id="mt"),
|
||||
# ("altering_replicated_mt","ReplicatedMergeTree('/clickhouse/altering_replicated_mt', '1')",),
|
||||
# SYSTEM STOP MERGES doesn't disable merges assignments
|
||||
])
|
||||
@ -827,9 +827,9 @@ def produce_alter_move(node, name):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("concurrently_altering_mt", "MergeTree()"),
|
||||
("concurrently_altering_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_altering_replicated_mt', '1')",),
|
||||
pytest.param("concurrently_altering_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("concurrently_altering_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_altering_replicated_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_concurrent_alter_move(start_cluster, name, engine):
|
||||
try:
|
||||
@ -882,9 +882,9 @@ def test_concurrent_alter_move(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("concurrently_dropping_mt", "MergeTree()"),
|
||||
("concurrently_dropping_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_dropping_replicated_mt', '1')",),
|
||||
pytest.param("concurrently_dropping_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("concurrently_dropping_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_dropping_replicated_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_concurrent_alter_move_and_drop(start_cluster, name, engine):
|
||||
try:
|
||||
@ -935,8 +935,8 @@ def test_concurrent_alter_move_and_drop(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("detach_attach_mt", "MergeTree()"),
|
||||
("replicated_detach_attach_mt", "ReplicatedMergeTree('/clickhouse/replicated_detach_attach_mt', '1')",),
|
||||
pytest.param("detach_attach_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_detach_attach_mt", "ReplicatedMergeTree('/clickhouse/replicated_detach_attach_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_detach_attach(start_cluster, name, engine):
|
||||
try:
|
||||
@ -966,8 +966,8 @@ def test_detach_attach(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mutating_mt", "MergeTree()"),
|
||||
("replicated_mutating_mt", "ReplicatedMergeTree('/clickhouse/replicated_mutating_mt', '1')",),
|
||||
pytest.param("mutating_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_mutating_mt", "ReplicatedMergeTree('/clickhouse/replicated_mutating_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_mutate_to_another_disk(start_cluster, name, engine):
|
||||
try:
|
||||
@ -1012,8 +1012,8 @@ def test_mutate_to_another_disk(start_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("alter_modifying_mt", "MergeTree()"),
|
||||
("replicated_alter_modifying_mt", "ReplicatedMergeTree('/clickhouse/replicated_alter_modifying_mt', '1')",),
|
||||
pytest.param("alter_modifying_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_alter_modifying_mt", "ReplicatedMergeTree('/clickhouse/replicated_alter_modifying_mt', '1')", id="replicated"),
|
||||
])
|
||||
def test_concurrent_alter_modify(start_cluster, name, engine):
|
||||
try:
|
||||
|
@ -220,60 +220,60 @@ timestamp_values_no_subsecond = ["'2015-05-18 07:40:01'", "'2019-09-16 19:20:11'
|
||||
# ("common_types", "FLOAT", "Nullable(Float32)", float_values, ""),
|
||||
# ("common_types", "FLOAT UNSIGNED", "Nullable(Float32)", float_values, ""),
|
||||
|
||||
("common_types", "INT", "Nullable(Int32)", int32_values, ""),
|
||||
("common_types", "INT NOT NULL", "Int32", int32_values, ""),
|
||||
("common_types", "INT UNSIGNED NOT NULL", "UInt32", uint32_values, ""),
|
||||
("common_types", "INT UNSIGNED", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INT UNSIGNED DEFAULT NULL", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INT UNSIGNED DEFAULT '1'", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INT(10)", "Nullable(Int32)", int32_values, ""),
|
||||
("common_types", "INT(10) NOT NULL", "Int32", int32_values, ""),
|
||||
("common_types", "INT(10) UNSIGNED NOT NULL", "UInt32", uint32_values, ""),
|
||||
("common_types", "INT(10) UNSIGNED", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INT(10) UNSIGNED DEFAULT NULL", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INT(10) UNSIGNED DEFAULT '1'", "Nullable(UInt32)", uint32_values, ""),
|
||||
("common_types", "INTEGER", "Nullable(Int32)", int32_values, ""),
|
||||
("common_types", "INTEGER UNSIGNED", "Nullable(UInt32)", uint32_values, ""),
|
||||
pytest.param("common_types", "INT", "Nullable(Int32)", int32_values, "", id="common_types_1"),
|
||||
pytest.param("common_types", "INT NOT NULL", "Int32", int32_values, "", id="common_types_2"),
|
||||
pytest.param("common_types", "INT UNSIGNED NOT NULL", "UInt32", uint32_values, "", id="common_types_3"),
|
||||
pytest.param("common_types", "INT UNSIGNED", "Nullable(UInt32)", uint32_values, "", id="common_types_4"),
|
||||
pytest.param("common_types", "INT UNSIGNED DEFAULT NULL", "Nullable(UInt32)", uint32_values, "", id="common_types_5"),
|
||||
pytest.param("common_types", "INT UNSIGNED DEFAULT '1'", "Nullable(UInt32)", uint32_values, "", id="common_types_6"),
|
||||
pytest.param("common_types", "INT(10)", "Nullable(Int32)", int32_values, "", id="common_types_7"),
|
||||
pytest.param("common_types", "INT(10) NOT NULL", "Int32", int32_values, "", id="common_types_8"),
|
||||
pytest.param("common_types", "INT(10) UNSIGNED NOT NULL", "UInt32", uint32_values, "", id="common_types_8"),
|
||||
pytest.param("common_types", "INT(10) UNSIGNED", "Nullable(UInt32)", uint32_values, "", id="common_types_9"),
|
||||
pytest.param("common_types", "INT(10) UNSIGNED DEFAULT NULL", "Nullable(UInt32)", uint32_values, "", id="common_types_10"),
|
||||
pytest.param("common_types", "INT(10) UNSIGNED DEFAULT '1'", "Nullable(UInt32)", uint32_values, "", id="common_types_11"),
|
||||
pytest.param("common_types", "INTEGER", "Nullable(Int32)", int32_values, "", id="common_types_12"),
|
||||
pytest.param("common_types", "INTEGER UNSIGNED", "Nullable(UInt32)", uint32_values, "", id="common_types_13"),
|
||||
|
||||
("common_types", "MEDIUMINT", "Nullable(Int32)", mint_values, ""),
|
||||
("common_types", "MEDIUMINT UNSIGNED", "Nullable(UInt32)", umint_values, ""),
|
||||
pytest.param("common_types", "MEDIUMINT", "Nullable(Int32)", mint_values, "", id="common_types_14"),
|
||||
pytest.param("common_types", "MEDIUMINT UNSIGNED", "Nullable(UInt32)", umint_values, "", id="common_types_15"),
|
||||
|
||||
("common_types", "SMALLINT", "Nullable(Int16)", int16_values, ""),
|
||||
("common_types", "SMALLINT UNSIGNED", "Nullable(UInt16)", uint16_values, ""),
|
||||
pytest.param("common_types", "SMALLINT", "Nullable(Int16)", int16_values, "", id="common_types_16"),
|
||||
pytest.param("common_types", "SMALLINT UNSIGNED", "Nullable(UInt16)", uint16_values, "", id="common_types_17"),
|
||||
|
||||
("common_types", "TINYINT", "Nullable(Int8)", int8_values, ""),
|
||||
("common_types", "TINYINT UNSIGNED", "Nullable(UInt8)", uint8_values, ""),
|
||||
pytest.param("common_types", "TINYINT", "Nullable(Int8)", int8_values, "", id="common_types_18"),
|
||||
pytest.param("common_types", "TINYINT UNSIGNED", "Nullable(UInt8)", uint8_values, "", id="common_types_19"),
|
||||
|
||||
("common_types", "VARCHAR(10)", "Nullable(String)", string_values, ""),
|
||||
pytest.param("common_types", "VARCHAR(10)", "Nullable(String)", string_values, "", id="common_types_20"),
|
||||
|
||||
|
||||
("decimal_default", "decimal NOT NULL", "Decimal(10, 0)", decimal_values,
|
||||
"decimal,datetime64"),
|
||||
("decimal_default_nullable", "decimal", "Nullable(Decimal(10, 0))", decimal_values,
|
||||
"decimal,datetime64"),
|
||||
("decimal_18_6", "decimal(18, 6) NOT NULL", "Decimal(18, 6)", decimal_values,
|
||||
"decimal,datetime64"),
|
||||
("decimal_38_6", "decimal(38, 6) NOT NULL", "Decimal(38, 6)", decimal_values,
|
||||
"decimal,datetime64"),
|
||||
pytest.param("decimal_default", "decimal NOT NULL", "Decimal(10, 0)", decimal_values,
|
||||
"decimal,datetime64", id="decimal_1"),
|
||||
pytest.param("decimal_default_nullable", "decimal", "Nullable(Decimal(10, 0))", decimal_values,
|
||||
"decimal,datetime64", id="decimal_2"),
|
||||
pytest.param("decimal_18_6", "decimal(18, 6) NOT NULL", "Decimal(18, 6)", decimal_values,
|
||||
"decimal,datetime64", id="decimal_3"),
|
||||
pytest.param("decimal_38_6", "decimal(38, 6) NOT NULL", "Decimal(38, 6)", decimal_values,
|
||||
"decimal,datetime64", id="decimal_4"),
|
||||
|
||||
# Due to python DB driver roundtrip MySQL timestamp and datetime values
|
||||
# are printed with 6 digits after decimal point, so to simplify tests a bit,
|
||||
# we only validate precision of 0 and 6.
|
||||
("timestamp_default", "timestamp", "DateTime", timestamp_values, "decimal,datetime64"),
|
||||
("timestamp_6", "timestamp(6)", "DateTime64(6)", timestamp_values, "decimal,datetime64"),
|
||||
("datetime_default", "DATETIME NOT NULL", "DateTime64(0)", timestamp_values,
|
||||
"decimal,datetime64"),
|
||||
("datetime_6", "DATETIME(6) NOT NULL", "DateTime64(6)", timestamp_values,
|
||||
"decimal,datetime64"),
|
||||
pytest.param("timestamp_default", "timestamp", "DateTime", timestamp_values, "decimal,datetime64", id="timestamp_default"),
|
||||
pytest.param("timestamp_6", "timestamp(6)", "DateTime64(6)", timestamp_values, "decimal,datetime64", id="timestamp_6"),
|
||||
pytest.param("datetime_default", "DATETIME NOT NULL", "DateTime64(0)", timestamp_values,
|
||||
"decimal,datetime64", id="datetime_default"),
|
||||
pytest.param("datetime_6", "DATETIME(6) NOT NULL", "DateTime64(6)", timestamp_values,
|
||||
"decimal,datetime64", id="datetime_6_1"),
|
||||
|
||||
# right now precision bigger than 39 is not supported by ClickHouse's Decimal, hence fall back to String
|
||||
("decimal_40_6", "decimal(40, 6) NOT NULL", "String", decimal_values,
|
||||
"decimal,datetime64"),
|
||||
("decimal_18_6", "decimal(18, 6) NOT NULL", "String", decimal_values, "datetime64"),
|
||||
("decimal_18_6", "decimal(18, 6) NOT NULL", "String", decimal_values, ""),
|
||||
("datetime_6", "DATETIME(6) NOT NULL", "DateTime", timestamp_values_no_subsecond,
|
||||
"decimal"),
|
||||
("datetime_6", "DATETIME(6) NOT NULL", "DateTime", timestamp_values_no_subsecond, ""),
|
||||
pytest.param("decimal_40_6", "decimal(40, 6) NOT NULL", "String", decimal_values,
|
||||
"decimal,datetime64", id="decimal_40_6"),
|
||||
pytest.param("decimal_18_6", "decimal(18, 6) NOT NULL", "String", decimal_values, "datetime64", id="decimal_18_6_1"),
|
||||
pytest.param("decimal_18_6", "decimal(18, 6) NOT NULL", "String", decimal_values, "", id="decimal_18_6_2"),
|
||||
pytest.param("datetime_6", "DATETIME(6) NOT NULL", "DateTime", timestamp_values_no_subsecond,
|
||||
"decimal", id="datetime_6_2"),
|
||||
pytest.param("datetime_6", "DATETIME(6) NOT NULL", "DateTime", timestamp_values_no_subsecond, "", id="datetime_6_3"),
|
||||
])
|
||||
def test_mysql_types(started_cluster, case_name, mysql_type, expected_ch_type, mysql_values,
|
||||
setting_mysql_datatypes_support_level):
|
||||
|
@ -39,12 +39,12 @@ def started_cluster():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("table,query,expected,n1,n2", [
|
||||
("sometable", "ALTER TABLE sometable DROP PARTITION 201706", '1', node1, node2),
|
||||
("sometable", "TRUNCATE TABLE sometable", '0', node1, node2),
|
||||
("sometable", "OPTIMIZE TABLE sometable", '4', node1, node2),
|
||||
("someothertable", "ALTER TABLE someothertable DROP PARTITION 201706", '1', node3, node4),
|
||||
("someothertable", "TRUNCATE TABLE someothertable", '0', node3, node4),
|
||||
("someothertable", "OPTIMIZE TABLE someothertable", '4', node3, node4),
|
||||
pytest.param("sometable", "ALTER TABLE sometable DROP PARTITION 201706", '1', node1, node2, id="case1"),
|
||||
pytest.param("sometable", "TRUNCATE TABLE sometable", '0', node1, node2, id="case2"),
|
||||
pytest.param("sometable", "OPTIMIZE TABLE sometable", '4', node1, node2, id="case3"),
|
||||
pytest.param("someothertable", "ALTER TABLE someothertable DROP PARTITION 201706", '1', node3, node4, id="case4"),
|
||||
pytest.param("someothertable", "TRUNCATE TABLE someothertable", '0', node3, node4, id="case5"),
|
||||
pytest.param("someothertable", "OPTIMIZE TABLE someothertable", '4', node3, node4, id="case6"),
|
||||
])
|
||||
def test_alter_table_drop_partition(started_cluster, table, query, expected, n1, n2):
|
||||
to_insert = '''\
|
||||
|
@ -73,12 +73,12 @@ def wait_parts_mover(node, table, *args, **kwargs):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,alter", [
|
||||
("mt_test_rule_with_invalid_destination", "MergeTree()", 0),
|
||||
("replicated_mt_test_rule_with_invalid_destination",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_rule_with_invalid_destination', '1')", 0),
|
||||
("mt_test_rule_with_invalid_destination", "MergeTree()", 1),
|
||||
("replicated_mt_test_rule_with_invalid_destination",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_rule_with_invalid_destination', '1')", 1),
|
||||
pytest.param("mt_test_rule_with_invalid_destination", "MergeTree()", 0, id="case0"),
|
||||
pytest.param("replicated_mt_test_rule_with_invalid_destination",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_rule_with_invalid_destination', '1')", 0, id="case1"),
|
||||
pytest.param("mt_test_rule_with_invalid_destination", "MergeTree()", 1, id="case2"),
|
||||
pytest.param("replicated_mt_test_rule_with_invalid_destination",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_rule_with_invalid_destination', '1')", 1, id="case3"),
|
||||
])
|
||||
def test_rule_with_invalid_destination(started_cluster, name, engine, alter):
|
||||
name = unique_table_name(name)
|
||||
@ -136,12 +136,12 @@ def test_rule_with_invalid_destination(started_cluster, name, engine, alter):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_inserts_to_disk_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_inserts_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_disk_do_not_work', '1')", 0),
|
||||
("mt_test_inserts_to_disk_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_inserts_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_disk_work', '1')", 1),
|
||||
pytest.param("mt_test_inserts_to_disk_do_not_work", "MergeTree()", 0, id="mt_test_inserts_to_disk_do_not_work"),
|
||||
pytest.param("replicated_mt_test_inserts_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_disk_do_not_work', '1')", 0, id="replicated_mt_test_inserts_to_disk_do_not_work"),
|
||||
pytest.param("mt_test_inserts_to_disk_work", "MergeTree()", 1, id="mt_test_inserts_to_disk_work_1"),
|
||||
pytest.param("replicated_mt_test_inserts_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_disk_work', '1')", 1, id="replicated_mt_test_inserts_to_disk_work_1"),
|
||||
])
|
||||
def test_inserts_to_disk_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -176,9 +176,9 @@ def test_inserts_to_disk_work(started_cluster, name, engine, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_test_moves_work_after_storage_policy_change", "MergeTree()"),
|
||||
("replicated_mt_test_moves_work_after_storage_policy_change",
|
||||
"ReplicatedMergeTree('/clickhouse/test_moves_work_after_storage_policy_change', '1')"),
|
||||
pytest.param("mt_test_moves_work_after_storage_policy_change", "MergeTree()", id="mt_test_moves_work_after_storage_policy_change"),
|
||||
pytest.param("replicated_mt_test_moves_work_after_storage_policy_change",
|
||||
"ReplicatedMergeTree('/clickhouse/test_moves_work_after_storage_policy_change', '1')", id="replicated_mt_test_moves_work_after_storage_policy_change"),
|
||||
])
|
||||
def test_moves_work_after_storage_policy_change(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -224,12 +224,12 @@ def test_moves_work_after_storage_policy_change(started_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_moves_to_disk_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_moves_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_do_not_work', '1')", 0),
|
||||
("mt_test_moves_to_disk_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_moves_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_work', '1')", 1),
|
||||
pytest.param("mt_test_moves_to_disk_do_not_work", "MergeTree()", 0, id="mt_test_moves_to_disk_do_not_work"),
|
||||
pytest.param("replicated_mt_test_moves_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_do_not_work', '1')", 0, id="replicated_mt_test_moves_to_disk_do_not_work"),
|
||||
pytest.param("mt_test_moves_to_disk_work", "MergeTree()", 1, id="mt_test_moves_to_disk_work"),
|
||||
pytest.param("replicated_mt_test_moves_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_work', '1')", 1, id="replicated_mt_test_moves_to_disk_work"),
|
||||
])
|
||||
def test_moves_to_disk_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -275,9 +275,9 @@ def test_moves_to_disk_work(started_cluster, name, engine, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_test_moves_to_volume_work", "MergeTree()"),
|
||||
("replicated_mt_test_moves_to_volume_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_volume_work', '1')"),
|
||||
pytest.param("mt_test_moves_to_volume_work", "MergeTree()", id="mt_test_moves_to_volume_work"),
|
||||
pytest.param("replicated_mt_test_moves_to_volume_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_volume_work', '1')", id="replicated_mt_test_moves_to_volume_work"),
|
||||
])
|
||||
def test_moves_to_volume_work(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -322,12 +322,12 @@ def test_moves_to_volume_work(started_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_inserts_to_volume_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_inserts_to_volume_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_volume_do_not_work', '1')", 0),
|
||||
("mt_test_inserts_to_volume_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_inserts_to_volume_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_volume_work', '1')", 1),
|
||||
pytest.param("mt_test_inserts_to_volume_do_not_work", "MergeTree()", 0, id="mt_test_inserts_to_volume_do_not_work"),
|
||||
pytest.param("replicated_mt_test_inserts_to_volume_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_volume_do_not_work', '1')", 0, id="replicated_mt_test_inserts_to_volume_do_not_work"),
|
||||
pytest.param("mt_test_inserts_to_volume_work", "MergeTree()", 1, id="mt_test_inserts_to_volume_work"),
|
||||
pytest.param("replicated_mt_test_inserts_to_volume_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_inserts_to_volume_work', '1')", 1, id="replicated_mt_test_inserts_to_volume_work"),
|
||||
])
|
||||
def test_inserts_to_volume_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -366,9 +366,9 @@ def test_inserts_to_volume_work(started_cluster, name, engine, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_test_moves_to_disk_eventually_work", "MergeTree()"),
|
||||
("replicated_mt_test_moves_to_disk_eventually_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_eventually_work', '1')"),
|
||||
pytest.param("mt_test_moves_to_disk_eventually_work", "MergeTree()", id="mt_test_moves_to_disk_eventually_work"),
|
||||
pytest.param("replicated_mt_test_moves_to_disk_eventually_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_to_disk_eventually_work', '1')", id="replicated_mt_test_moves_to_disk_eventually_work"),
|
||||
])
|
||||
def test_moves_to_disk_eventually_work(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -460,12 +460,12 @@ def test_replicated_download_ttl_info(started_cluster):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_merges_to_disk_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_merges_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_to_disk_do_not_work', '1')", 0),
|
||||
("mt_test_merges_to_disk_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_merges_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_to_disk_work', '1')", 1),
|
||||
pytest.param("mt_test_merges_to_disk_do_not_work", "MergeTree()", 0, id="mt_test_merges_to_disk_do_not_work"),
|
||||
pytest.param("replicated_mt_test_merges_to_disk_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_to_disk_do_not_work', '1')", 0, id="mt_test_merges_to_disk_do_not_work"),
|
||||
pytest.param("mt_test_merges_to_disk_work", "MergeTree()", 1, id="mt_test_merges_to_disk_work"),
|
||||
pytest.param("replicated_mt_test_merges_to_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_to_disk_work', '1')", 1, id="replicated_mt_test_merges_to_disk_work"),
|
||||
])
|
||||
def test_merges_to_disk_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -524,9 +524,9 @@ def test_merges_to_disk_work(started_cluster, name, engine, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_test_merges_with_full_disk_work", "MergeTree()"),
|
||||
("replicated_mt_test_merges_with_full_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_with_full_disk_work', '1')"),
|
||||
pytest.param("mt_test_merges_with_full_disk_work", "MergeTree()", id="mt_test_merges_with_full_disk_work"),
|
||||
pytest.param("replicated_mt_test_merges_with_full_disk_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_merges_with_full_disk_work', '1')", id="replicated_mt_test_merges_with_full_disk_work"),
|
||||
])
|
||||
def test_merges_with_full_disk_work(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -596,12 +596,12 @@ def test_merges_with_full_disk_work(started_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_moves_after_merges_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_moves_after_merges_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_merges_do_not_work', '1')", 0),
|
||||
("mt_test_moves_after_merges_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_moves_after_merges_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_merges_work', '1')", 1),
|
||||
pytest.param("mt_test_moves_after_merges_do_not_work", "MergeTree()", 0, id="mt_test_moves_after_merges_do_not_work"),
|
||||
pytest.param("replicated_mt_test_moves_after_merges_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_merges_do_not_work', '1')", 0, id="replicated_mt_test_moves_after_merges_do_not_work"),
|
||||
pytest.param("mt_test_moves_after_merges_work", "MergeTree()", 1, id="mt_test_moves_after_merges_work"),
|
||||
pytest.param("replicated_mt_test_moves_after_merges_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_merges_work', '1')", 1, id="replicated_mt_test_moves_after_merges_work"),
|
||||
])
|
||||
def test_moves_after_merges_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -654,18 +654,18 @@ def test_moves_after_merges_work(started_cluster, name, engine, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive,bar", [
|
||||
("mt_test_moves_after_alter_do_not_work", "MergeTree()", 0, "DELETE"),
|
||||
("replicated_mt_test_moves_after_alter_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_do_not_work', '1')", 0, "DELETE"),
|
||||
("mt_test_moves_after_alter_work", "MergeTree()", 1, "DELETE"),
|
||||
("replicated_mt_test_moves_after_alter_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_work', '1')", 1, "DELETE"),
|
||||
("mt_test_moves_after_alter_do_not_work", "MergeTree()", 0, "TO DISK 'external'"),
|
||||
("replicated_mt_test_moves_after_alter_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_do_not_work', '1')", 0, "TO DISK 'external'"),
|
||||
("mt_test_moves_after_alter_work", "MergeTree()", 1, "TO DISK 'external'"),
|
||||
("replicated_mt_test_moves_after_alter_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_work', '1')", 1, "TO DISK 'external'"),
|
||||
pytest.param("mt_test_moves_after_alter_do_not_work", "MergeTree()", 0, "DELETE", id="mt_negative"),
|
||||
pytest.param("replicated_mt_test_moves_after_alter_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_do_not_work', '1')", 0, "DELETE", id="repicated_negative"),
|
||||
pytest.param("mt_test_moves_after_alter_work", "MergeTree()", 1, "DELETE", id="mt_positive"),
|
||||
pytest.param("replicated_mt_test_moves_after_alter_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_work', '1')", 1, "DELETE", id="repicated_positive"),
|
||||
pytest.param("mt_test_moves_after_alter_do_not_work", "MergeTree()", 0, "TO DISK 'external'", id="mt_external_negative"),
|
||||
pytest.param("replicated_mt_test_moves_after_alter_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_do_not_work', '1')", 0, "TO DISK 'external'", id="replicated_external_negative"),
|
||||
pytest.param("mt_test_moves_after_alter_work", "MergeTree()", 1, "TO DISK 'external'", id="mt_external_positive"),
|
||||
pytest.param("replicated_mt_test_moves_after_alter_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_moves_after_alter_work', '1')", 1, "TO DISK 'external'", id="replicated_external_positive"),
|
||||
])
|
||||
def test_ttls_do_not_work_after_alter(started_cluster, name, engine, positive, bar):
|
||||
name = unique_table_name(name)
|
||||
@ -704,9 +704,9 @@ def test_ttls_do_not_work_after_alter(started_cluster, name, engine, positive, b
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("mt_test_materialize_ttl_in_partition", "MergeTree()"),
|
||||
("replicated_mt_test_materialize_ttl_in_partition",
|
||||
"ReplicatedMergeTree('/clickhouse/test_materialize_ttl_in_partition', '1')"),
|
||||
pytest.param("mt_test_materialize_ttl_in_partition", "MergeTree()", id="mt"),
|
||||
pytest.param("replicated_mt_test_materialize_ttl_in_partition",
|
||||
"ReplicatedMergeTree('/clickhouse/test_materialize_ttl_in_partition', '1')", id="replicated"),
|
||||
])
|
||||
def test_materialize_ttl_in_partition(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -769,12 +769,12 @@ def test_materialize_ttl_in_partition(started_cluster, name, engine):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_alter_multiple_ttls_positive", "MergeTree()", True),
|
||||
("mt_replicated_test_alter_multiple_ttls_positive",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_multiple_ttls_positive', '1')", True),
|
||||
("mt_test_alter_multiple_ttls_negative", "MergeTree()", False),
|
||||
("mt_replicated_test_alter_multiple_ttls_negative",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_multiple_ttls_negative', '1')", False),
|
||||
pytest.param("mt_test_alter_multiple_ttls_positive", "MergeTree()", True, id="positive"),
|
||||
pytest.param("mt_replicated_test_alter_multiple_ttls_positive",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_multiple_ttls_positive', '1')", True, id="replicated_positive"),
|
||||
pytest.param("mt_test_alter_multiple_ttls_negative", "MergeTree()", False, id="negative"),
|
||||
pytest.param("mt_replicated_test_alter_multiple_ttls_negative",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_multiple_ttls_negative', '1')", False, id="replicated_negative"),
|
||||
])
|
||||
def test_alter_multiple_ttls(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -868,9 +868,9 @@ limitations under the License."""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("concurrently_altering_ttl_mt", "MergeTree()"),
|
||||
("concurrently_altering_ttl_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_altering_ttl_replicated_mt', '1')",),
|
||||
pytest.param("concurrently_altering_ttl_mt", "MergeTree()", id="mt"),
|
||||
pytest.param("concurrently_altering_ttl_replicated_mt",
|
||||
"ReplicatedMergeTree('/clickhouse/concurrently_altering_ttl_replicated_mt', '1')", id="replicated_mt"),
|
||||
])
|
||||
def test_concurrent_alter_with_ttl_move(started_cluster, name, engine):
|
||||
name = unique_table_name(name)
|
||||
@ -977,8 +977,8 @@ def test_concurrent_alter_with_ttl_move(started_cluster, name, engine):
|
||||
|
||||
@pytest.mark.skip(reason="Flacky test")
|
||||
@pytest.mark.parametrize("name,positive", [
|
||||
("test_double_move_while_select_negative", 0),
|
||||
("test_double_move_while_select_positive", 1),
|
||||
pytest.param("test_double_move_while_select_negative", 0, id="negative"),
|
||||
pytest.param("test_double_move_while_select_positive", 1, id="positive"),
|
||||
])
|
||||
def test_double_move_while_select(started_cluster, name, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -1038,12 +1038,12 @@ def test_double_move_while_select(started_cluster, name, positive):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,engine,positive", [
|
||||
("mt_test_alter_with_merge_do_not_work", "MergeTree()", 0),
|
||||
("replicated_mt_test_alter_with_merge_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_with_merge_do_not_work', '1')", 0),
|
||||
("mt_test_alter_with_merge_work", "MergeTree()", 1),
|
||||
("replicated_mt_test_alter_with_merge_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_with_merge_work', '1')", 1),
|
||||
pytest.param("mt_test_alter_with_merge_do_not_work", "MergeTree()", 0, id="mt"),
|
||||
pytest.param("replicated_mt_test_alter_with_merge_do_not_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_with_merge_do_not_work', '1')", 0, id="replicated"),
|
||||
pytest.param("mt_test_alter_with_merge_work", "MergeTree()", 1, id="mt_work"),
|
||||
pytest.param("replicated_mt_test_alter_with_merge_work",
|
||||
"ReplicatedMergeTree('/clickhouse/replicated_test_alter_with_merge_work', '1')", 1, id="replicated_work"),
|
||||
])
|
||||
def test_alter_with_merge_work(started_cluster, name, engine, positive):
|
||||
name = unique_table_name(name)
|
||||
@ -1131,10 +1131,10 @@ limitations under the License."""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,dest_type,engine", [
|
||||
("mt_test_disabled_ttl_move_on_insert_work", "DISK", "MergeTree()"),
|
||||
("mt_test_disabled_ttl_move_on_insert_work", "VOLUME", "MergeTree()"),
|
||||
("replicated_mt_test_disabled_ttl_move_on_insert_work", "DISK", "ReplicatedMergeTree('/clickhouse/replicated_test_disabled_ttl_move_on_insert_work', '1')"),
|
||||
("replicated_mt_test_disabled_ttl_move_on_insert_work", "VOLUME", "ReplicatedMergeTree('/clickhouse/replicated_test_disabled_ttl_move_on_insert_work', '1')"),
|
||||
pytest.param("mt_test_disabled_ttl_move_on_insert_work", "DISK", "MergeTree()", id="disk"),
|
||||
pytest.param("mt_test_disabled_ttl_move_on_insert_work", "VOLUME", "MergeTree()", id="volume"),
|
||||
pytest.param("replicated_mt_test_disabled_ttl_move_on_insert_work", "DISK", "ReplicatedMergeTree('/clickhouse/replicated_test_disabled_ttl_move_on_insert_work', '1')", id="replicated_disk"),
|
||||
pytest.param("replicated_mt_test_disabled_ttl_move_on_insert_work", "VOLUME", "ReplicatedMergeTree('/clickhouse/replicated_test_disabled_ttl_move_on_insert_work', '1')", id="replicated_volume"),
|
||||
])
|
||||
def test_disabled_ttl_move_on_insert(started_cluster, name, dest_type, engine):
|
||||
name = unique_table_name(name)
|
||||
|
@ -227,8 +227,8 @@ def optimize_with_retry(node, table_name, retry=20):
|
||||
time.sleep(0.5)
|
||||
|
||||
@pytest.mark.parametrize("name,engine", [
|
||||
("test_ttl_alter_delete", "MergeTree()"),
|
||||
("test_replicated_ttl_alter_delete", "ReplicatedMergeTree('/clickhouse/test_replicated_ttl_alter_delete', '1')"),
|
||||
pytest.param("test_ttl_alter_delete", "MergeTree()", id="test_ttl_alter_delete"),
|
||||
pytest.param("test_replicated_ttl_alter_delete", "ReplicatedMergeTree('/clickhouse/test_replicated_ttl_alter_delete', '1')", id="test_ttl_alter_delete_replicated"),
|
||||
])
|
||||
def test_ttl_alter_delete(started_cluster, name, engine):
|
||||
"""Copyright 2019, Altinity LTD
|
||||
|
Loading…
Reference in New Issue
Block a user