From 77dfa4425605757bc34703b4719e7152244f072f Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Fri, 24 Sep 2021 12:16:08 +0300 Subject: [PATCH 1/9] Generate test_results.tsv for fasttest --- docker/test/fasttest/Dockerfile | 1 + docker/test/fasttest/run.sh | 1 + docker/test/{stateless => }/process_functional_tests_result.py | 0 docker/test/stateless/Dockerfile | 2 +- 4 files changed, 3 insertions(+), 1 deletion(-) rename docker/test/{stateless => }/process_functional_tests_result.py (100%) diff --git a/docker/test/fasttest/Dockerfile b/docker/test/fasttest/Dockerfile index 3119b2f1bb3..39c7118d939 100644 --- a/docker/test/fasttest/Dockerfile +++ b/docker/test/fasttest/Dockerfile @@ -89,4 +89,5 @@ ENV PULL_REQUEST_NUMBER='' ENV COPY_CLICKHOUSE_BINARY_TO_OUTPUT=0 COPY run.sh / +COPY ../process_functional_tests_result.py / CMD ["/bin/bash", "/run.sh"] diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index 0cda2f8f17f..f11b3d88405 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -315,6 +315,7 @@ case "$stage" in ;& "run_tests") run_tests + ./process_functional_tests_result.py "$FASTTEST_OUTPUT/" || echo -e "failure\tCannot parse results" > "$FASTTEST_OUTPUT/check_status.tsv" ;; *) echo "Unknown test stage '$stage'" diff --git a/docker/test/stateless/process_functional_tests_result.py b/docker/test/process_functional_tests_result.py similarity index 100% rename from docker/test/stateless/process_functional_tests_result.py rename to docker/test/process_functional_tests_result.py diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index 3b5edb2c869..17acaf6011e 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -60,6 +60,6 @@ ENV MINIO_ROOT_USER="clickhouse" ENV MINIO_ROOT_PASSWORD="clickhouse" COPY run.sh / -COPY process_functional_tests_result.py / +COPY ../process_functional_tests_result.py / COPY setup_minio.sh / CMD ["/bin/bash", "/run.sh"] From 98df97f5d930598ecbf856f7dd0be18667a90b68 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Fri, 24 Sep 2021 13:48:28 +0300 Subject: [PATCH 2/9] Fix docker image --- docker/test/fasttest/Dockerfile | 2 +- docker/test/stateless/Dockerfile | 2 +- docker/test/util/Dockerfile | 4 ++++ docker/test/{ => util}/process_functional_tests_result.py | 0 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 docker/test/util/Dockerfile rename docker/test/{ => util}/process_functional_tests_result.py (100%) diff --git a/docker/test/fasttest/Dockerfile b/docker/test/fasttest/Dockerfile index 39c7118d939..f8fbbdd6f02 100644 --- a/docker/test/fasttest/Dockerfile +++ b/docker/test/fasttest/Dockerfile @@ -1,5 +1,6 @@ # docker build -t clickhouse/fasttest . FROM ubuntu:20.04 +FROM clickhouse/test-util ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13 @@ -89,5 +90,4 @@ ENV PULL_REQUEST_NUMBER='' ENV COPY_CLICKHOUSE_BINARY_TO_OUTPUT=0 COPY run.sh / -COPY ../process_functional_tests_result.py / CMD ["/bin/bash", "/run.sh"] diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index 17acaf6011e..e559847a4ba 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -1,5 +1,6 @@ # docker build -t clickhouse/stateless-test . FROM clickhouse/test-base +FROM clickhouse/test-util ARG odbc_driver_url="https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.1.4.20200302/clickhouse-odbc-1.1.4-Linux.tar.gz" @@ -60,6 +61,5 @@ ENV MINIO_ROOT_USER="clickhouse" ENV MINIO_ROOT_PASSWORD="clickhouse" COPY run.sh / -COPY ../process_functional_tests_result.py / COPY setup_minio.sh / CMD ["/bin/bash", "/run.sh"] diff --git a/docker/test/util/Dockerfile b/docker/test/util/Dockerfile new file mode 100644 index 00000000000..304469733f5 --- /dev/null +++ b/docker/test/util/Dockerfile @@ -0,0 +1,4 @@ +# docker build -t clickhouse/test-util . + +FROM scratch +COPY process_functional_tests_result.py / diff --git a/docker/test/process_functional_tests_result.py b/docker/test/util/process_functional_tests_result.py similarity index 100% rename from docker/test/process_functional_tests_result.py rename to docker/test/util/process_functional_tests_result.py From 4e6c945fdf5f466d4b353dec81b3821c8ad0a79c Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Mon, 27 Sep 2021 13:09:00 +0300 Subject: [PATCH 3/9] Rename fasttest output file --- docker/test/fasttest/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index f11b3d88405..e4f2921effa 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -266,7 +266,7 @@ function run_tests --fast-tests-only --no-long --testname --shard --zookeeper \ -- "$FASTTEST_FOCUS" 2>&1 \ | ts '%Y-%m-%d %H:%M:%S' \ - | tee "$FASTTEST_OUTPUT/test_log.txt" + | tee "$FASTTEST_OUTPUT/test_result.txt" } case "$stage" in From d9ce2c2d99a5359823321340066911651276653a Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Mon, 27 Sep 2021 15:59:20 +0300 Subject: [PATCH 4/9] Update images.json --- docker/images.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/images.json b/docker/images.json index 96424bb9432..f4f31c50f63 100644 --- a/docker/images.json +++ b/docker/images.json @@ -41,6 +41,13 @@ "name": "clickhouse/pvs-test", "dependent": [] }, + "docker/test/util": { + "name": "clickhouse/test-util", + "dependent": [ + "docker/test/fasttest", + "docker/test/stateless" + ] + }, "docker/test/stateless": { "name": "clickhouse/stateless-test", "dependent": [ From 5418ea83faa31a14c980a7d3cf252e7dc93f6871 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Mon, 27 Sep 2021 17:38:25 +0300 Subject: [PATCH 5/9] Fix clickhouse/test-util Dockerfile --- docker/test/util/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/util/Dockerfile b/docker/test/util/Dockerfile index 304469733f5..d9894451528 100644 --- a/docker/test/util/Dockerfile +++ b/docker/test/util/Dockerfile @@ -1,4 +1,4 @@ # docker build -t clickhouse/test-util . -FROM scratch +FROM ubuntu:20.04 COPY process_functional_tests_result.py / From 7755b3688f1101172fe96b021221086bc9147bba Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 28 Sep 2021 01:07:53 +0300 Subject: [PATCH 6/9] Fix docker images build --- docker/test/fasttest/Dockerfile | 2 +- docker/test/stateless/Dockerfile | 2 +- docker/test/util/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/test/fasttest/Dockerfile b/docker/test/fasttest/Dockerfile index f8fbbdd6f02..61a8e5269c2 100644 --- a/docker/test/fasttest/Dockerfile +++ b/docker/test/fasttest/Dockerfile @@ -1,6 +1,6 @@ # docker build -t clickhouse/fasttest . -FROM ubuntu:20.04 FROM clickhouse/test-util +FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13 diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index e559847a4ba..c7d747ac46f 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -1,6 +1,6 @@ # docker build -t clickhouse/stateless-test . -FROM clickhouse/test-base FROM clickhouse/test-util +FROM clickhouse/test-base ARG odbc_driver_url="https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.1.4.20200302/clickhouse-odbc-1.1.4-Linux.tar.gz" diff --git a/docker/test/util/Dockerfile b/docker/test/util/Dockerfile index d9894451528..304469733f5 100644 --- a/docker/test/util/Dockerfile +++ b/docker/test/util/Dockerfile @@ -1,4 +1,4 @@ # docker build -t clickhouse/test-util . -FROM ubuntu:20.04 +FROM scratch COPY process_functional_tests_result.py / From 4ce12a7685b1cdbaf596dd59764e4d69980ce83a Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 28 Sep 2021 11:50:28 +0300 Subject: [PATCH 7/9] Fixup --- docker/images.json | 3 +-- docker/test/base/Dockerfile | 2 +- docker/test/fasttest/Dockerfile | 1 - docker/test/stateless/Dockerfile | 1 - docker/test/util/Dockerfile | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docker/images.json b/docker/images.json index f4f31c50f63..6e4f1b84782 100644 --- a/docker/images.json +++ b/docker/images.json @@ -44,8 +44,7 @@ "docker/test/util": { "name": "clickhouse/test-util", "dependent": [ - "docker/test/fasttest", - "docker/test/stateless" + "docker/test/base" ] }, "docker/test/stateless": { diff --git a/docker/test/base/Dockerfile b/docker/test/base/Dockerfile index 2d49c207ac3..caaeff912e7 100644 --- a/docker/test/base/Dockerfile +++ b/docker/test/base/Dockerfile @@ -1,5 +1,5 @@ # docker build -t clickhouse/test-base . -FROM ubuntu:20.04 +FROM clickhouse/test-util ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13 diff --git a/docker/test/fasttest/Dockerfile b/docker/test/fasttest/Dockerfile index 61a8e5269c2..798910fb952 100644 --- a/docker/test/fasttest/Dockerfile +++ b/docker/test/fasttest/Dockerfile @@ -1,6 +1,5 @@ # docker build -t clickhouse/fasttest . FROM clickhouse/test-util -FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13 diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index c7d747ac46f..7de8c061673 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -1,5 +1,4 @@ # docker build -t clickhouse/stateless-test . -FROM clickhouse/test-util FROM clickhouse/test-base ARG odbc_driver_url="https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.1.4.20200302/clickhouse-odbc-1.1.4-Linux.tar.gz" diff --git a/docker/test/util/Dockerfile b/docker/test/util/Dockerfile index 304469733f5..d9894451528 100644 --- a/docker/test/util/Dockerfile +++ b/docker/test/util/Dockerfile @@ -1,4 +1,4 @@ # docker build -t clickhouse/test-util . -FROM scratch +FROM ubuntu:20.04 COPY process_functional_tests_result.py / From 6b12869f6e7a3b18ac4d653af45f2781965a7583 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 28 Sep 2021 15:11:18 +0300 Subject: [PATCH 8/9] Fix path to executable --- docker/test/fasttest/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index e4f2921effa..d92e0b31a87 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -315,7 +315,7 @@ case "$stage" in ;& "run_tests") run_tests - ./process_functional_tests_result.py "$FASTTEST_OUTPUT/" || echo -e "failure\tCannot parse results" > "$FASTTEST_OUTPUT/check_status.tsv" + /process_functional_tests_result.py "$FASTTEST_OUTPUT/" || echo -e "failure\tCannot parse results" > "$FASTTEST_OUTPUT/check_status.tsv" ;; *) echo "Unknown test stage '$stage'" From 29587c50136791ad6a69f91fe2afabe6c6d5c3d3 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 28 Sep 2021 20:38:41 +0300 Subject: [PATCH 9/9] Pass all parameters to process_functional_tests_result.py --- docker/test/fasttest/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index d92e0b31a87..c8a3ad7c998 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -315,7 +315,9 @@ case "$stage" in ;& "run_tests") run_tests - /process_functional_tests_result.py "$FASTTEST_OUTPUT/" || echo -e "failure\tCannot parse results" > "$FASTTEST_OUTPUT/check_status.tsv" + /process_functional_tests_result.py --in-results-dir "$FASTTEST_OUTPUT/" \ + --out-results-file "$FASTTEST_OUTPUT/test_results.tsv" \ + --out-status-file "$FASTTEST_OUTPUT/check_status.tsv" || echo -e "failure\tCannot parse results" > "$FASTTEST_OUTPUT/check_status.tsv" ;; *) echo "Unknown test stage '$stage'"