Stateless tests: add access directory

This commit is contained in:
Nikita Fomichev 2024-08-27 18:09:18 +02:00
parent 92722fc5bf
commit 882c133902
6 changed files with 37 additions and 9 deletions

View File

@ -1584,8 +1584,6 @@ class TestCase:
coverage_prefix = os.getenv("CLICKHOUSE_WRITE_COVERAGE", "coverage")
file_pattern = coverage_prefix + ".*"
matching_files = glob.glob(file_pattern)
# TODO remove before merge
print(result.case_name, coverage_prefix, matching_files)
for file_path in matching_files:
try:
body = read_file_as_binary_string(file_path)
@ -1727,11 +1725,27 @@ class TestCase:
f"PORT {os.environ['CLICKHOUSE_PORT_TCP']}",
"PORT 9000",
)
replace_in_file(
self.stdout_file,
f"port {os.environ['CLICKHOUSE_PORT_TCP']}",
"port 9000",
)
replace_in_file(
self.stdout_file,
f"localhost {os.environ['CLICKHOUSE_PORT_TCP']}",
"localhost 9000",
)
replace_in_file(
self.stdout_file,
f"127.0.0.1:{os.environ['CLICKHOUSE_PORT_TCP']}",
"127.0.0.1:9000",
)
if os.environ.get("CLICKHOUSE_PORT_MYSQL"):
replace_in_file(
self.stdout_file,
f"127.0.0.1:{os.environ['CLICKHOUSE_PORT_MYSQL']}",
"127.0.0.1:9004",
)
if os.environ.get("CLICKHOUSE_PORT_TCP_SECURE"):
replace_in_file(
@ -2634,7 +2648,7 @@ def do_run_tests(jobs, test_suite: TestSuite):
manager = multiprocessing.Manager()
parallel_tests = manager.list()
parallel_tests.extend(test_suite.parallel_tests)
is_concurrent = jobs > 1
is_concurrent = (jobs > 1) or (args.run_parallel_only or args.run_no_parallel_only)
processes = []
for _ in range(jobs):

View File

@ -0,0 +1,7 @@
<clickhouse>
<user_directories>
<local_directory>
<path>/var/lib/clickhouse/access/</path>
</local_directory>
</user_directories>
</clickhouse>

View File

@ -70,6 +70,7 @@ ln -sf $SRC_PATH/config.d/block_number.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/handlers.yaml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/serverwide_trace_collector.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/rocksdb.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/user_directories.xml $DEST_SERVER_PATH/config.d/
# Not supported with fasttest.
if [ "${DEST_SERVER_PATH}" = "/etc/clickhouse-server" ]

View File

@ -7,15 +7,20 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} --query "SYSTEM DROP DNS CACHE"
${CLICKHOUSE_CLIENT} --query "
DROP USER IF EXISTS dns_fail_1, dns_fail_2;
DROP USER IF EXISTS dns_fail_1, dns_fail_2, dns_fail_3;
CREATE USER dns_fail_1 HOST NAME 'non.existing.host.name', '${MYHOSTNAME}';
CREATE USER dns_fail_2 HOST NAME '${MYHOSTNAME}', 'non.existing.host.name';"
CREATE USER dns_fail_2 HOST NAME '${MYHOSTNAME}', 'non.existing.host.name';
CREATE USER dns_fail_3 HOST NAME 'localhost', 'non.existing.host.name';"
${CLICKHOUSE_CLIENT} --query "SELECT 1" --user dns_fail_1 --host ${MYHOSTNAME}
${CLICKHOUSE_CLIENT} --query "SELECT 2" --user dns_fail_2 --host ${MYHOSTNAME}
${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS dns_fail_1, dns_fail_2"
${CLICKHOUSE_CLIENT} --query "SELECT 3" --user dns_fail_3 --host ${MYHOSTNAME}
${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS dns_fail_1, dns_fail_2, dns_fail_3"
${CLICKHOUSE_CLIENT} --query "SYSTEM DROP DNS CACHE"

View File

@ -17,7 +17,7 @@ SELECT 'prefer_localhost_replica=1, remote query with a lot of union all' AS tes
-- query with lot of dummy union all will create a lot of streams
-- let's check how many threads clickhouse will start for that
select count() from remote('127.0.0.1:9000', view(
select count() from remote('127.0.0.1', view(
{% for n in range(77) -%}
SELECT * FROM system.one {{ "UNION ALL" if not loop.last }}
{% endfor -%}
@ -49,7 +49,7 @@ WHERE
--------------------
SELECT 'prefer_localhost_replica=0, remote query with a lot of union all' AS testname;
select count() from remote('127.0.0.1:9000', view(
select count() from remote('127.0.0.1', view(
{% for n in range(77) -%}
SELECT * FROM system.one {{ "UNION ALL" if not loop.last }}
{% endfor -%}
@ -85,7 +85,7 @@ SELECT 'prefer_localhost_replica=1, async_socket_for_remote=0, remote query with
-- now is happens only for async_socket_for_remote=0 (while it is 1 by default)
-- see https://github.com/ClickHouse/ClickHouse/issues/53287
select count() from remote('127.0.0.1:9000', view(
select count() from remote('127.0.0.1', view(
{% for n in range(77) -%}
SELECT * FROM system.one {{ "UNION ALL" if not loop.last }}
{% endfor -%}