mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
test: yaml merge keys
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
439229ef2b
commit
4770446dbe
@ -0,0 +1,41 @@
|
||||
---
|
||||
settings_common: &settings_common
|
||||
max_threads: 1
|
||||
max_final_threads: 1
|
||||
|
||||
settings_extended: &settings_extended
|
||||
max_final_threads: 2
|
||||
|
||||
profiles:
|
||||
profile_1:
|
||||
<<: *settings_common
|
||||
profile_2:
|
||||
<<: *settings_common
|
||||
max_threads: 4
|
||||
profile_3:
|
||||
max_threads: 4
|
||||
<<: *settings_common
|
||||
profile_4:
|
||||
<<: *settings_common
|
||||
<<: *settings_extended
|
||||
max_threads: 4
|
||||
profile_5:
|
||||
<<: [*settings_common, *settings_extended]
|
||||
max_threads: 4
|
||||
|
||||
users:
|
||||
user_1:
|
||||
profile: profile_1
|
||||
password: ""
|
||||
user_2:
|
||||
profile: profile_2
|
||||
password: ""
|
||||
user_3:
|
||||
profile: profile_3
|
||||
password: ""
|
||||
user_4:
|
||||
profile: profile_4
|
||||
password: ""
|
||||
user_5:
|
||||
profile: profile_5
|
||||
password: ""
|
68
tests/integration/test_config_yaml_merge_keys/test.py
Normal file
68
tests/integration/test_config_yaml_merge_keys/test.py
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
|
||||
import helpers
|
||||
import pytest
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
|
||||
|
||||
def test_yaml_merge_keys_conf():
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
node = cluster.add_instance(
|
||||
"node",
|
||||
user_configs=["configs/merge_keys.yml"]
|
||||
)
|
||||
|
||||
try:
|
||||
cluster.start()
|
||||
|
||||
# Assert simple merge key substitution
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_threads')", user="user_1"
|
||||
) == "1\n"
|
||||
)
|
||||
|
||||
# Assert merge key overriden by regular key
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_threads')", user="user_2"
|
||||
) == "4\n"
|
||||
)
|
||||
|
||||
# Assert normal key overriden by merge key
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_threads')", user="user_3"
|
||||
) == "1\n"
|
||||
)
|
||||
|
||||
# Assert override with multiple merge keys
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_final_threads')", user="user_4"
|
||||
) == "2\n"
|
||||
)
|
||||
|
||||
# Assert multiple merge key substitutions overriden by regular key
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_threads')", user="user_4"
|
||||
) == "4\n"
|
||||
)
|
||||
|
||||
# Assert override with multiple merge keys for list syntax
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_final_threads')", user="user_5"
|
||||
) == "2\n"
|
||||
)
|
||||
|
||||
# Assert multiple merge key substitutions overriden by regular key
|
||||
# for list syntax
|
||||
assert(
|
||||
node.query(
|
||||
"select getSetting('max_threads')", user="user_5"
|
||||
) == "4\n"
|
||||
)
|
||||
finally:
|
||||
cluster.shutdown()
|
Loading…
Reference in New Issue
Block a user