From 9b9982ee3dc6f3649190aad6a19308f44e6e3135 Mon Sep 17 00:00:00 2001 From: Artur Filatenkov <613623@mail.ru> Date: Wed, 4 Aug 2021 12:53:41 +0300 Subject: [PATCH] correct test with deleting files after usage --- .../queries/0_stateless/02001_compress_output_file.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/queries/0_stateless/02001_compress_output_file.sh b/tests/queries/0_stateless/02001_compress_output_file.sh index 336c8319ee4..11df227cc14 100755 --- a/tests/queries/0_stateless/02001_compress_output_file.sh +++ b/tests/queries/0_stateless/02001_compress_output_file.sh @@ -4,10 +4,20 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CURDIR"/../shell_config.sh +set -e + +[ -e "${CLICKHOUSE_TMP}"/test_compression_of_output_file_from_client.gz ] && rm "${CLICKHOUSE_TMP}"/test_compression_of_output_file_from_client.gz + ${CLICKHOUSE_CLIENT} --query "SELECT * FROM (SELECT 'Hello, World! From client.') INTO OUTFILE '${CLICKHOUSE_TMP}/test_compression_of_output_file_from_client.gz'" gunzip ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_client.gz cat ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_client +rm -f "${CLICKHOUSE_TMP}/test_compression_of_output_file_from_client" + +[ -e "${CLICKHOUSE_TMP}"/test_compression_of_output_file_from_local.gz ] && rm "${CLICKHOUSE_TMP}"/test_compression_of_output_file_from_local.gz + ${CLICKHOUSE_LOCAL} --query "SELECT * FROM (SELECT 'Hello, World! From local.') INTO OUTFILE '${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local.gz'" gunzip ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local.gz cat ${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local + +rm -f "${CLICKHOUSE_TMP}/test_compression_of_output_file_from_local"