From 6b9397e805f056dfb64b54e188268d82d7bf045b Mon Sep 17 00:00:00 2001 From: Vladimir Chebotarev Date: Mon, 17 Jun 2019 01:10:49 +0300 Subject: [PATCH] Tests fixes. --- .../clickhouse-test | 18 +++++++++--------- .../00950_table_function_s3_wip/config.xml | 4 ++-- .../00950_table_function_s3_wip/test.csv | 3 +++ 3 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00950_table_function_s3_wip/test.csv diff --git a/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/clickhouse-test b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/clickhouse-test index 554effe027..39c62f835a 100755 --- a/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/clickhouse-test +++ b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/clickhouse-test @@ -8,11 +8,11 @@ import threading import unittest -# 1) Run Go FakeS3 server. -# go run cmd/gofakes3/main.go -backend memory -host :9990 -# 2) Create a bucket. -# curl -X PUT http://localhost:9990/abc/ +# Run Go FakeS3 server. +# go run cmd/gofakes3/main.go -backend memory -host :9990 -initialbucket abc +config = os.path.join(os.path.dirname(sys.argv[0]), 'config.xml') +test_csv = os.path.join(os.path.dirname(sys.argv[0]), 'test.csv') format = 'column1 UInt32, column2 UInt32, column3 UInt32' values = '(1, 2, 3), (3, 2, 1), (78, 43, 45)' other_values = '(1, 1, 1), (1, 1, 1), (11, 11, 11)' @@ -30,7 +30,7 @@ prepare_put_queries = [ ] queries = [ - "select *, column1*column2*column3 from file('{}', 'CSV', '{}')".format(os.path.expanduser('~/test.csv'), format), + "select *, column1*column2*column3 from file('{}', 'CSV', '{}')".format(test_csv, format), "select *, column1*column2*column3 from url('https://storage.yandexcloud.net/milovidov/test.csv', 'CSV', '{}')".format(format), "select *, column1*column2*column3 from s3('http://storage.yandexcloud.net/milovidov/test.csv', 'CSV', '{}')".format(format), "select *, column1*column2*column3 from s3('http://{}:{}/{}/test.csv', 'CSV', '{}')".format(localhost, fakes3_port, bucket, format), @@ -166,7 +166,7 @@ for query in prepare_put_queries: result = subprocess.run([ os.path.expanduser('~/ClickHouse-bin/dbms/programs/clickhouse-local'), '-c', - os.path.expanduser('~/config.xml'), + config, '-q', query ], stdout=subprocess.PIPE, universal_newlines=True) @@ -177,7 +177,7 @@ for query in queries: result = subprocess.run([ os.path.expanduser('~/ClickHouse-bin/dbms/programs/clickhouse-local'), '-c', - os.path.expanduser('~/config.xml'), + config, '-q', query ], stdout=subprocess.PIPE, universal_newlines=True) @@ -193,7 +193,7 @@ for query in put_queries: result = subprocess.run([ os.path.expanduser('~/ClickHouse-bin/dbms/programs/clickhouse-local'), '-c', - os.path.expanduser('~/config.xml'), + config, '-q', query ], stdout=subprocess.PIPE, universal_newlines=True) @@ -207,7 +207,7 @@ for query in check_queries: result = subprocess.run([ os.path.expanduser('~/ClickHouse-bin/dbms/programs/clickhouse-local'), '-c', - os.path.expanduser('~/config.xml'), + config, '-q', query ], stdout=subprocess.PIPE, universal_newlines=True) diff --git a/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/config.xml b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/config.xml index de0dd0a708..7675c69645 100644 --- a/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/config.xml +++ b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/config.xml @@ -2,8 +2,8 @@ default trace - /home/excitoon/clickhouse-server.log - /home/excitoon/clickhouse-server.err.log + ~/clickhouse-server.log + ~/clickhouse-server.err.log 1000M 10 diff --git a/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/test.csv b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/test.csv new file mode 100644 index 0000000000..a2325127de --- /dev/null +++ b/dbms/tests/queries/0_stateless/00950_table_function_s3_wip/test.csv @@ -0,0 +1,3 @@ +1,2,3 +3,2,1 +78,43,45 -- GitLab