Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
fac881a6
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fac881a6
编写于
8月 14, 2020
作者:
Y
Yatsishin Ilya
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
finally remove config_dir
上级
73e9f4d4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
35 deletion
+14
-35
tests/integration/helpers/cluster.py
tests/integration/helpers/cluster.py
+5
-16
tests/integration/test_distributed_ddl/cluster.py
tests/integration/test_distributed_ddl/cluster.py
+5
-11
tests/integration/test_polymorphic_parts/test.py
tests/integration/test_polymorphic_parts/test.py
+4
-4
tests/integration/test_reloading_storage_configuration/test.py
.../integration/test_reloading_storage_configuration/test.py
+0
-2
tests/integration/test_system_merges/test.py
tests/integration/test_system_merges/test.py
+0
-2
未找到文件。
tests/integration/helpers/cluster.py
浏览文件 @
fac881a6
...
@@ -89,7 +89,7 @@ class ClickHouseCluster:
...
@@ -89,7 +89,7 @@ class ClickHouseCluster:
these directories will contain logs, database files, docker-compose config, ClickHouse configs etc.
these directories will contain logs, database files, docker-compose config, ClickHouse configs etc.
"""
"""
def
__init__
(
self
,
base_path
,
name
=
None
,
base_config_dir
=
None
,
config_dir
=
None
,
server_bin_path
=
None
,
client_bin_path
=
None
,
def
__init__
(
self
,
base_path
,
name
=
None
,
base_config_dir
=
None
,
server_bin_path
=
None
,
client_bin_path
=
None
,
odbc_bridge_bin_path
=
None
,
zookeeper_config_path
=
None
,
custom_dockerd_host
=
None
):
odbc_bridge_bin_path
=
None
,
zookeeper_config_path
=
None
,
custom_dockerd_host
=
None
):
for
param
in
os
.
environ
.
keys
():
for
param
in
os
.
environ
.
keys
():
print
"ENV %40s %s"
%
(
param
,
os
.
environ
[
param
])
print
"ENV %40s %s"
%
(
param
,
os
.
environ
[
param
])
...
@@ -98,8 +98,6 @@ class ClickHouseCluster:
...
@@ -98,8 +98,6 @@ class ClickHouseCluster:
self
.
base_config_dir
=
base_config_dir
or
os
.
environ
.
get
(
'CLICKHOUSE_TESTS_BASE_CONFIG_DIR'
,
self
.
base_config_dir
=
base_config_dir
or
os
.
environ
.
get
(
'CLICKHOUSE_TESTS_BASE_CONFIG_DIR'
,
'/etc/clickhouse-server/'
)
'/etc/clickhouse-server/'
)
self
.
config_dir
=
config_dir
or
os
.
environ
.
get
(
'CLICKHOUSE_TESTS_CONFIG_DIR'
,
'/etc/clickhouse-server/'
)
self
.
server_bin_path
=
p
.
realpath
(
self
.
server_bin_path
=
p
.
realpath
(
server_bin_path
or
os
.
environ
.
get
(
'CLICKHOUSE_TESTS_SERVER_BIN_PATH'
,
'/usr/bin/clickhouse'
))
server_bin_path
or
os
.
environ
.
get
(
'CLICKHOUSE_TESTS_SERVER_BIN_PATH'
,
'/usr/bin/clickhouse'
))
self
.
odbc_bridge_bin_path
=
p
.
realpath
(
odbc_bridge_bin_path
or
get_odbc_bridge_path
())
self
.
odbc_bridge_bin_path
=
p
.
realpath
(
odbc_bridge_bin_path
or
get_odbc_bridge_path
())
...
@@ -159,7 +157,7 @@ class ClickHouseCluster:
...
@@ -159,7 +157,7 @@ class ClickHouseCluster:
self
.
docker_client
=
None
self
.
docker_client
=
None
self
.
is_up
=
False
self
.
is_up
=
False
print
"CLUSTER INIT base_config_dir:{}
config_dir:{}"
.
format
(
self
.
base_config_dir
,
self
.
config_dir
)
print
"CLUSTER INIT base_config_dir:{}
"
.
format
(
self
.
base_
config_dir
)
def
get_client_cmd
(
self
):
def
get_client_cmd
(
self
):
cmd
=
self
.
client_bin_path
cmd
=
self
.
client_bin_path
...
@@ -167,7 +165,7 @@ class ClickHouseCluster:
...
@@ -167,7 +165,7 @@ class ClickHouseCluster:
cmd
+=
" client"
cmd
+=
" client"
return
cmd
return
cmd
def
add_instance
(
self
,
name
,
base_config_dir
=
None
,
config_dir
=
None
,
main_configs
=
None
,
user_configs
=
None
,
dictionaries
=
None
,
macros
=
None
,
def
add_instance
(
self
,
name
,
base_config_dir
=
None
,
main_configs
=
None
,
user_configs
=
None
,
dictionaries
=
None
,
macros
=
None
,
with_zookeeper
=
False
,
with_mysql
=
False
,
with_kafka
=
False
,
with_rabbitmq
=
False
,
clickhouse_path_dir
=
None
,
with_zookeeper
=
False
,
with_mysql
=
False
,
with_kafka
=
False
,
with_rabbitmq
=
False
,
clickhouse_path_dir
=
None
,
with_odbc_drivers
=
False
,
with_postgres
=
False
,
with_hdfs
=
False
,
with_mongo
=
False
,
with_odbc_drivers
=
False
,
with_postgres
=
False
,
with_hdfs
=
False
,
with_mongo
=
False
,
with_redis
=
False
,
with_minio
=
False
,
with_cassandra
=
False
,
with_redis
=
False
,
with_minio
=
False
,
with_cassandra
=
False
,
...
@@ -177,7 +175,6 @@ class ClickHouseCluster:
...
@@ -177,7 +175,6 @@ class ClickHouseCluster:
"""Add an instance to the cluster.
"""Add an instance to the cluster.
name - the name of the instance directory and the value of the 'instance' macro in ClickHouse.
name - the name of the instance directory and the value of the 'instance' macro in ClickHouse.
config_dir - a directory with config files which content will be copied to /etc/clickhouse-server/ directory
base_config_dir - a directory with config.xml and users.xml files which will be copied to /etc/clickhouse-server/ directory
base_config_dir - a directory with config.xml and users.xml files which will be copied to /etc/clickhouse-server/ directory
main_configs - a list of config files that will be added to config.d/ directory
main_configs - a list of config files that will be added to config.d/ directory
user_configs - a list of config files that will be added to users.d/ directory
user_configs - a list of config files that will be added to users.d/ directory
...
@@ -192,8 +189,7 @@ class ClickHouseCluster:
...
@@ -192,8 +189,7 @@ class ClickHouseCluster:
instance
=
ClickHouseInstance
(
instance
=
ClickHouseInstance
(
self
,
self
.
base_dir
,
name
,
base_config_dir
if
base_config_dir
else
self
.
base_config_dir
,
self
,
self
.
base_dir
,
name
,
base_config_dir
if
base_config_dir
else
self
.
base_config_dir
,
config_dir
if
config_dir
else
self
.
config_dir
,
main_configs
or
[],
user_configs
or
[],
dictionaries
or
[],
main_configs
or
[],
user_configs
or
[],
dictionaries
or
[],
macros
or
{},
with_zookeeper
,
macros
or
{},
with_zookeeper
,
self
.
zookeeper_config_path
,
with_mysql
,
with_kafka
,
with_rabbitmq
,
with_mongo
,
with_redis
,
with_minio
,
with_cassandra
,
self
.
zookeeper_config_path
,
with_mysql
,
with_kafka
,
with_rabbitmq
,
with_mongo
,
with_redis
,
with_minio
,
with_cassandra
,
self
.
server_bin_path
,
self
.
odbc_bridge_bin_path
,
clickhouse_path_dir
,
with_odbc_drivers
,
hostname
=
hostname
,
self
.
server_bin_path
,
self
.
odbc_bridge_bin_path
,
clickhouse_path_dir
,
with_odbc_drivers
,
hostname
=
hostname
,
env_variables
=
env_variables
or
{},
image
=
image
,
stay_alive
=
stay_alive
,
ipv4_address
=
ipv4_address
,
env_variables
=
env_variables
or
{},
image
=
image
,
stay_alive
=
stay_alive
,
ipv4_address
=
ipv4_address
,
...
@@ -765,7 +761,7 @@ services:
...
@@ -765,7 +761,7 @@ services:
class
ClickHouseInstance
:
class
ClickHouseInstance
:
def
__init__
(
def
__init__
(
self
,
cluster
,
base_path
,
name
,
base_config_dir
,
c
onfig_dir
,
c
ustom_main_configs
,
custom_user_configs
,
custom_dictionaries
,
self
,
cluster
,
base_path
,
name
,
base_config_dir
,
custom_main_configs
,
custom_user_configs
,
custom_dictionaries
,
macros
,
with_zookeeper
,
zookeeper_config_path
,
with_mysql
,
with_kafka
,
with_rabbitmq
,
with_mongo
,
with_redis
,
with_minio
,
macros
,
with_zookeeper
,
zookeeper_config_path
,
with_mysql
,
with_kafka
,
with_rabbitmq
,
with_mongo
,
with_redis
,
with_minio
,
with_cassandra
,
server_bin_path
,
odbc_bridge_bin_path
,
with_cassandra
,
server_bin_path
,
odbc_bridge_bin_path
,
clickhouse_path_dir
,
with_odbc_drivers
,
hostname
=
None
,
env_variables
=
None
,
clickhouse_path_dir
,
with_odbc_drivers
,
hostname
=
None
,
env_variables
=
None
,
...
@@ -780,7 +776,6 @@ class ClickHouseInstance:
...
@@ -780,7 +776,6 @@ class ClickHouseInstance:
self
.
tmpfs
=
tmpfs
or
[]
self
.
tmpfs
=
tmpfs
or
[]
self
.
base_config_dir
=
p
.
abspath
(
p
.
join
(
base_path
,
base_config_dir
))
if
base_config_dir
else
None
self
.
base_config_dir
=
p
.
abspath
(
p
.
join
(
base_path
,
base_config_dir
))
if
base_config_dir
else
None
self
.
config_dir
=
p
.
abspath
(
p
.
join
(
base_path
,
config_dir
))
if
config_dir
else
None
self
.
custom_main_config_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_main_configs
]
self
.
custom_main_config_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_main_configs
]
self
.
custom_user_config_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_user_configs
]
self
.
custom_user_config_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_user_configs
]
self
.
custom_dictionaries_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_dictionaries
]
self
.
custom_dictionaries_paths
=
[
p
.
abspath
(
p
.
join
(
base_path
,
c
))
for
c
in
custom_dictionaries
]
...
@@ -1126,10 +1121,6 @@ class ClickHouseInstance:
...
@@ -1126,10 +1121,6 @@ class ClickHouseInstance:
if
self
.
with_zookeeper
:
if
self
.
with_zookeeper
:
shutil
.
copy
(
self
.
zookeeper_config_path
,
conf_d_dir
)
shutil
.
copy
(
self
.
zookeeper_config_path
,
conf_d_dir
)
# print "Copy config dir {} to {}".format(self.config_dir, instance_config_dir)
# if self.config_dir:
# distutils.dir_util.copy_tree(self.config_dir, instance_config_dir)
# Copy config.d configs
# Copy config.d configs
print
"Copy custom test config files {} to {}"
.
format
(
self
.
custom_main_config_paths
,
self
.
config_d_dir
)
print
"Copy custom test config files {} to {}"
.
format
(
self
.
custom_main_config_paths
,
self
.
config_d_dir
)
for
path
in
self
.
custom_main_config_paths
:
for
path
in
self
.
custom_main_config_paths
:
...
@@ -1139,8 +1130,6 @@ class ClickHouseInstance:
...
@@ -1139,8 +1130,6 @@ class ClickHouseInstance:
for
path
in
self
.
custom_user_config_paths
:
for
path
in
self
.
custom_user_config_paths
:
shutil
.
copy
(
path
,
users_d_dir
)
shutil
.
copy
(
path
,
users_d_dir
)
self
.
config_dir
# Copy dictionaries configs to configs/dictionaries
# Copy dictionaries configs to configs/dictionaries
for
path
in
self
.
custom_dictionaries_paths
:
for
path
in
self
.
custom_dictionaries_paths
:
shutil
.
copy
(
path
,
dictionaries_dir
)
shutil
.
copy
(
path
,
dictionaries_dir
)
...
...
tests/integration/test_distributed_ddl/cluster.py
浏览文件 @
fac881a6
...
@@ -17,18 +17,12 @@ class ClickHouseClusterWithDDLHelpers(ClickHouseCluster):
...
@@ -17,18 +17,12 @@ class ClickHouseClusterWithDDLHelpers(ClickHouseCluster):
def
prepare
(
self
,
replace_hostnames_with_ips
=
True
):
def
prepare
(
self
,
replace_hostnames_with_ips
=
True
):
try
:
try
:
main_configs
=
[
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/clusters.xml"
),
main_configs_files
=
[
"clusters.xml"
,
"zookeeper_session_timeout.xml"
,
"macro.xml"
),
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/zookeeper_session_timeout.xml"
),
"query_log.xml"
,
"ddl.xml"
]
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/macro.xml"
),
main_configs
=
[
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d"
,
f
)
for
f
in
main_configs_files
)]
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/query_log.xml"
),
user_configs
=
[
os
.
path
.
join
(
self
.
test_config_dir
,
"users.d"
,
f
)
for
f
in
[
"restricted_user.xml"
,
"query_log.xml"
]]
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/ddl.xml"
)]
user_configs
=
[
os
.
path
.
join
(
self
.
test_config_dir
,
"users.d/restricted_user.xml"
),
os
.
path
.
join
(
self
.
test_config_dir
,
"users.d/query_log.xml"
)]
if
self
.
test_config_dir
==
"configs_secure"
:
if
self
.
test_config_dir
==
"configs_secure"
:
main_configs
+=
[
os
.
path
.
join
(
self
.
test_config_dir
,
"server.crt"
),
main_configs
+=
[
os
.
path
.
join
(
self
.
test_config_dir
,
f
)
for
i
in
[
"server.crt"
,
"server.key"
,
"dhparam.pem"
,
"config.d/ssl_conf.xml"
]]
os
.
path
.
join
(
self
.
test_config_dir
,
"server.key"
),
os
.
path
.
join
(
self
.
test_config_dir
,
"dhparam.pem"
),
os
.
path
.
join
(
self
.
test_config_dir
,
"config.d/ssl_conf.xml"
)]
for
i
in
xrange
(
4
):
for
i
in
xrange
(
4
):
self
.
add_instance
(
self
.
add_instance
(
'ch{}'
.
format
(
i
+
1
),
'ch{}'
.
format
(
i
+
1
),
...
...
tests/integration/test_polymorphic_parts/test.py
浏览文件 @
fac881a6
...
@@ -71,11 +71,11 @@ node6 = cluster.add_instance('node6', main_configs=['configs/compact_parts.xml']
...
@@ -71,11 +71,11 @@ node6 = cluster.add_instance('node6', main_configs=['configs/compact_parts.xml']
settings_in_memory
=
{
'index_granularity_bytes'
:
10485760
,
'min_rows_for_wide_part'
:
512
,
'min_rows_for_compact_part'
:
256
}
settings_in_memory
=
{
'index_granularity_bytes'
:
10485760
,
'min_rows_for_wide_part'
:
512
,
'min_rows_for_compact_part'
:
256
}
node9
=
cluster
.
add_instance
(
'node9'
,
config_dir
=
"configs"
,
with_zookeeper
=
True
,
stay_alive
=
True
)
node9
=
cluster
.
add_instance
(
'node9'
,
with_zookeeper
=
True
,
stay_alive
=
True
)
node10
=
cluster
.
add_instance
(
'node10'
,
config_dir
=
"configs"
,
with_zookeeper
=
True
)
node10
=
cluster
.
add_instance
(
'node10'
,
with_zookeeper
=
True
)
node11
=
cluster
.
add_instance
(
'node11'
,
config_dir
=
"configs"
,
main_configs
=
[
'configs/do_not_merge.xml'
],
with_zookeeper
=
True
,
stay_alive
=
True
)
node11
=
cluster
.
add_instance
(
'node11'
,
main_configs
=
[
'configs/do_not_merge.xml'
],
with_zookeeper
=
True
,
stay_alive
=
True
)
node12
=
cluster
.
add_instance
(
'node12'
,
config_dir
=
"configs"
,
main_configs
=
[
'configs/do_not_merge.xml'
],
with_zookeeper
=
True
,
stay_alive
=
True
)
node12
=
cluster
.
add_instance
(
'node12'
,
main_configs
=
[
'configs/do_not_merge.xml'
],
with_zookeeper
=
True
,
stay_alive
=
True
)
@
pytest
.
fixture
(
scope
=
"module"
)
@
pytest
.
fixture
(
scope
=
"module"
)
def
start_cluster
():
def
start_cluster
():
...
...
tests/integration/test_reloading_storage_configuration/test.py
浏览文件 @
fac881a6
...
@@ -14,7 +14,6 @@ import helpers.cluster
...
@@ -14,7 +14,6 @@ import helpers.cluster
cluster
=
helpers
.
cluster
.
ClickHouseCluster
(
__file__
)
cluster
=
helpers
.
cluster
.
ClickHouseCluster
(
__file__
)
node1
=
cluster
.
add_instance
(
'node1'
,
node1
=
cluster
.
add_instance
(
'node1'
,
config_dir
=
'configs'
,
main_configs
=
[
'configs/logs_config.xml'
],
main_configs
=
[
'configs/logs_config.xml'
],
with_zookeeper
=
True
,
with_zookeeper
=
True
,
stay_alive
=
True
,
stay_alive
=
True
,
...
@@ -22,7 +21,6 @@ node1 = cluster.add_instance('node1',
...
@@ -22,7 +21,6 @@ node1 = cluster.add_instance('node1',
macros
=
{
"shard"
:
0
,
"replica"
:
1
}
)
macros
=
{
"shard"
:
0
,
"replica"
:
1
}
)
node2
=
cluster
.
add_instance
(
'node2'
,
node2
=
cluster
.
add_instance
(
'node2'
,
config_dir
=
'configs'
,
main_configs
=
[
'configs/logs_config.xml'
],
main_configs
=
[
'configs/logs_config.xml'
],
with_zookeeper
=
True
,
with_zookeeper
=
True
,
stay_alive
=
True
,
stay_alive
=
True
,
...
...
tests/integration/test_system_merges/test.py
浏览文件 @
fac881a6
...
@@ -6,13 +6,11 @@ from helpers.cluster import ClickHouseCluster
...
@@ -6,13 +6,11 @@ from helpers.cluster import ClickHouseCluster
cluster
=
ClickHouseCluster
(
__file__
)
cluster
=
ClickHouseCluster
(
__file__
)
node1
=
cluster
.
add_instance
(
'node1'
,
node1
=
cluster
.
add_instance
(
'node1'
,
config_dir
=
'configs'
,
main_configs
=
[
'configs/logs_config.xml'
],
main_configs
=
[
'configs/logs_config.xml'
],
with_zookeeper
=
True
,
with_zookeeper
=
True
,
macros
=
{
"shard"
:
0
,
"replica"
:
1
}
)
macros
=
{
"shard"
:
0
,
"replica"
:
1
}
)
node2
=
cluster
.
add_instance
(
'node2'
,
node2
=
cluster
.
add_instance
(
'node2'
,
config_dir
=
'configs'
,
main_configs
=
[
'configs/logs_config.xml'
],
main_configs
=
[
'configs/logs_config.xml'
],
with_zookeeper
=
True
,
with_zookeeper
=
True
,
macros
=
{
"shard"
:
0
,
"replica"
:
2
}
)
macros
=
{
"shard"
:
0
,
"replica"
:
2
}
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录