Move to separate directory

This commit is contained in:
Alexey Milovidov 2022-01-03 03:44:03 +03:00
parent 2c7a8db58c
commit 53e3ecb90d
6 changed files with 95 additions and 18 deletions

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<clickhouse>
<logger>
<level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
</logger>
<http_port>8123</http_port>
<listen_host>127.0.0.1</listen_host>
<path>./clickhouse/</path>
<users_config>users.xml</users_config>
</clickhouse>

View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<clickhouse>
<profiles>
<default>
</default>
</profiles>
<users>
<default>
<password>123</password>
<networks incl="networks" replace="replace">
<ip>::/0</ip>
</networks>
<profile>default</profile>
<quota>default</quota>
</default>
<user_with_empty_password>
<password></password>
<networks incl="networks" replace="replace">
<ip>::/0</ip>
</networks>
<profile>default</profile>
<quota>default</quota>
</user_with_empty_password>
</users>
<quotas>
<default>
</default>
</quotas>
</clickhouse>

View File

@ -0,0 +1,47 @@
# coding: utf-8
import datetime
import math
import os
import time
import logging
import docker
import pytest
from docker.models.containers import Container
from helpers.cluster import ClickHouseCluster, get_docker_compose_path, run_and_check
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
DOCKER_COMPOSE_PATH = get_docker_compose_path()
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
user_configs=["configs/users.xml"], env_variables={'UBSAN_OPTIONS': 'print_stacktrace=1'})
@pytest.fixture(scope="module")
def started_cluster():
cluster.start()
try:
yield cluster
finally:
cluster.shutdown()
@pytest.fixture(scope='module')
def dotnet_container():
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_dotnet_client.yml')
run_and_check(
['docker-compose', '-p', cluster.project_name, '-f', docker_compose, 'up', '--no-recreate', '-d', '--no-build'])
yield docker.from_env().containers.get(cluster.project_name + '_dotnet1_1')
def test_dotnet_client(started_cluster, dotnet_container):
with open(os.path.join(SCRIPT_DIR, 'dotnet.reference'), 'rb') as fp:
reference = fp.read()
code, (stdout, stderr) = dotnet_container.exec_run(
'dotnet run --host {host} --port {port} --user default --password 123 --database default'
.format(host=started_cluster.get_instance_ip('node'), port=8123), demux=True)
assert code == 0
assert stdout == reference

View File

@ -38,12 +38,6 @@ def golang_container():
['docker-compose', '-p', cluster.project_name, '-f', docker_compose, 'up', '--no-recreate', '-d', '--no-build'])
yield docker.DockerClient(base_url='unix:///var/run/docker.sock', version=cluster.docker_api_version, timeout=600).containers.get(cluster.project_name + '_golang1_1')
@pytest.fixture(scope='module')
def dotnet_container():
docker_compose = os.path.join(DOCKER_COMPOSE_PATH, 'docker_compose_dotnet_client.yml')
run_and_check(
['docker-compose', '-p', cluster.project_name, '-f', docker_compose, 'up', '--no-recreate', '-d', '--no-build'])
yield docker.from_env().containers.get(cluster.project_name + '_dotnet1_1')
@pytest.fixture(scope='module')
def php_container():
@ -408,18 +402,6 @@ def test_golang_client(started_cluster, golang_container):
assert stdout == reference
def test_dotnet_client(started_cluster, dotnet_container):
with open(os.path.join(SCRIPT_DIR, 'dotnet.reference'), 'rb') as fp:
reference = fp.read()
code, (stdout, stderr) = dotnet_container.exec_run(
'dotnet run --host {host} --port {port} --user default --password 123 --database default'
.format(host=started_cluster.get_instance_ip('node'), port=server_port), demux=True)
assert code == 0
assert stdout == reference
def test_php_client(started_cluster, php_container):
# type: (str, Container) -> None
code, (stdout, stderr) = php_container.exec_run(