mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Normalize hostname in CI
This commit is contained in:
parent
98326ec028
commit
b541b5eca3
@ -27,6 +27,7 @@ except ImportError:
|
||||
import random
|
||||
import string
|
||||
import multiprocessing
|
||||
import socket
|
||||
from contextlib import closing
|
||||
|
||||
USE_JINJA = True
|
||||
@ -267,6 +268,9 @@ def run_single_test(args, ext, server_logs_level, client_options, case_file, std
|
||||
os.system("LC_ALL=C sed -i -e 's|/auto_{{shard}}||g' {file}".format(file=stdout_file))
|
||||
os.system("LC_ALL=C sed -i -e 's|auto_{{replica}}||g' {file}".format(file=stdout_file))
|
||||
|
||||
# Normalize hostname in stdout file.
|
||||
os.system("LC_ALL=C sed -i -e 's/{hostname}/localhost/g' {file}".format(hostname=socket.gethostname(), file=stdout_file))
|
||||
|
||||
stdout = open(stdout_file, 'rb').read() if os.path.exists(stdout_file) else b''
|
||||
stdout = str(stdout, errors='replace', encoding='utf-8')
|
||||
stderr = open(stderr_file, 'rb').read() if os.path.exists(stderr_file) else b''
|
||||
|
2
tests/queries/0_stateless/02001_hostname_test.reference
Normal file
2
tests/queries/0_stateless/02001_hostname_test.reference
Normal file
@ -0,0 +1,2 @@
|
||||
localhost
|
||||
localhost 2
|
2
tests/queries/0_stateless/02001_hostname_test.sql
Normal file
2
tests/queries/0_stateless/02001_hostname_test.sql
Normal file
@ -0,0 +1,2 @@
|
||||
select hostname();
|
||||
select hostName() h, count() from cluster(test_cluster_two_shards, system.one) group by h;
|
Loading…
Reference in New Issue
Block a user