Merge pull request #59975 from ClickHouse/analyzer-fix-test_settings_profile

Analyzer: Fix test_settings_profile
This commit is contained in:
Dmitry Novik 2024-02-15 17:44:43 +01:00 committed by GitHub
commit cc59e06fea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 7 deletions

View File

@ -8,5 +8,4 @@ test_merge_table_over_distributed/test.py::test_global_in
test_merge_table_over_distributed/test.py::test_select_table_name_from_merge_over_distributed
test_passing_max_partitions_to_read_remotely/test.py::test_default_database_on_cluster
test_select_access_rights/test_main.py::test_alias_columns
test_settings_profile/test.py::test_show_profiles
test_sql_user_defined_functions_on_cluster/test.py::test_sql_user_defined_functions_on_cluster

View File

@ -454,22 +454,41 @@ def test_show_profiles():
assert instance.query("SHOW PROFILES") == "default\nreadonly\nxyz\n"
assert instance.query("SHOW CREATE PROFILE xyz") == "CREATE SETTINGS PROFILE xyz\n"
query_possible_response = [
"CREATE SETTINGS PROFILE default\n",
"CREATE SETTINGS PROFILE default SETTINGS allow_experimental_analyzer = true\n",
]
assert (
instance.query("SHOW CREATE SETTINGS PROFILE default")
== "CREATE SETTINGS PROFILE default\n"
in query_possible_response
)
assert (
instance.query("SHOW CREATE PROFILES") == "CREATE SETTINGS PROFILE default\n"
query_possible_response = [
"CREATE SETTINGS PROFILE default\n"
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
"CREATE SETTINGS PROFILE xyz\n"
)
"CREATE SETTINGS PROFILE xyz\n",
"CREATE SETTINGS PROFILE default SETTINGS allow_experimental_analyzer = true\n"
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
"CREATE SETTINGS PROFILE xyz\n",
]
assert instance.query("SHOW CREATE PROFILES") in query_possible_response
expected_access = (
"CREATE SETTINGS PROFILE default\n"
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
"CREATE SETTINGS PROFILE xyz\n"
)
assert expected_access in instance.query("SHOW ACCESS")
expected_access_analyzer = (
"CREATE SETTINGS PROFILE default SETTINGS allow_experimental_analyzer = true\n"
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
"CREATE SETTINGS PROFILE xyz\n"
)
query_response = instance.query("SHOW ACCESS")
assert (
expected_access in query_response or expected_access_analyzer in query_response
)
def test_set_profile():