From cb178d7a071df3b7e9b06c1c07676260c7c86f18 Mon Sep 17 00:00:00 2001 From: kamille Date: Tue, 5 Sep 2023 21:50:23 +0800 Subject: [PATCH] support building test but not updating the related repos(e.g. ceresmeta, tsbs, dist-query-testing...). --- integration_tests/Makefile | 3 +++ integration_tests/build_meta.sh | 8 ++++++-- integration_tests/dist_query/run.sh | 30 +++++++++++++++++++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/integration_tests/Makefile b/integration_tests/Makefile index 71a3164489..ebb0d69793 100644 --- a/integration_tests/Makefile +++ b/integration_tests/Makefile @@ -25,6 +25,9 @@ export CLUSTER_CERESDB_STDOUT_FILE_0 ?= /tmp/ceresdb-stdout-0.log export CLUSTER_CERESDB_STDOUT_FILE_1 ?= /tmp/ceresdb-stdout-1.log export RUST_BACKTRACE=1 +# Whether update related repos +export UPDATE_REPOS_TO_LATEST ?= true + clean: rm -rf $(CERESDB_DATA_DIR) $(CERESDB_DATA_DIR_0) $(CERESDB_DATA_DIR_1) $(CERESMETA_DATA_DIR) diff --git a/integration_tests/build_meta.sh b/integration_tests/build_meta.sh index ea0cc18783..c9a7787895 100755 --- a/integration_tests/build_meta.sh +++ b/integration_tests/build_meta.sh @@ -5,11 +5,15 @@ set -e SRC=/tmp/ceresmeta-src TARGET=$(pwd)/ceresmeta -if [ -d $SRC ]; then +if [[ -d $SRC && $UPDATE_REPOS_TO_LATEST == 'true' ]]; then echo "Remove old meta..." rm -rf $SRC fi -git clone --depth 1 https://github.com/ceresdb/ceresmeta.git ${SRC} +if [[ ! -d $SRC ]]; then + echo "Pull meta repo..." + git clone --depth 1 https://github.com/ceresdb/ceresmeta.git ${SRC} +fi + cd ${SRC} go build -o ${TARGET}/ceresmeta ./cmd/meta/... diff --git a/integration_tests/dist_query/run.sh b/integration_tests/dist_query/run.sh index 117e8ef44b..766bdab17a 100755 --- a/integration_tests/dist_query/run.sh +++ b/integration_tests/dist_query/run.sh @@ -28,7 +28,7 @@ export HOST_NUM=${HOST_NUM:-10000} export TS_START="2022-09-05T00:00:00Z" export TS_END="2022-09-05T01:00:01Z" export EXE_FILE_NAME=${CURR_DIR}/tsbs/tsbs_generate_queries -# where generated queries stored +# Where generated queries stored export BULK_DATA_DIR=${CURR_DIR}/dist-query-testing/tsbs-cpu-only export FORMATS=ceresdb # Used for `generate_queries.sh` end. @@ -38,8 +38,10 @@ single-groupby-1-8-1 \ single-groupby-5-1-1 \ single-groupby-5-8-1" export QUERIES=20 - -export QUERY_RESPONSE_FILE=${CURR_DIR}/output/resp.txt +# Where query results stored +export QUERY_RESULTS_FILE=${CURR_DIR}/output/resp.txt +TSBS_REPO_PATH=${CURR_DIR}/tsbs +DATA_REPO_PATH=${CURR_DIR}/dist-query-testing set -x @@ -56,9 +58,25 @@ mkdir -p ${LOG_DIR} # Prepare components ## tsbs -git clone -b support-partitioned-table --depth 1 --single-branch https://github.com/Rachelint/tsbs.git +if [[ -d ${TSBS_REPO_PATH} && $UPDATE_REPOS_TO_LATEST == 'true' ]]; then + echo "Remove old tsbs..." + rm -rf ${TSBS_REPO_PATH} +fi + +if [[ ! -d ${TSBS_REPO_PATH} ]]; then + echo "Pull tsbs repo..." + git clone -b support-partitioned-table --depth 1 --single-branch https://github.com/Rachelint/tsbs.git +fi ## data -git clone -b main --depth 1 --single-branch https://github.com/CeresDB/dist-query-testing.git +if [[ -d ${DATA_REPO_PATH} && $UPDATE_REPOS_TO_LATEST == 'true' ]]; then + echo "Remove old dist query testing..." + rm -rf ${DATA_REPO_PATH} +fi + +if [[ ! -d ${DATA_REPO_PATH} ]]; then + echo "Pull old dist query testing repo..." + git clone -b main --depth 1 --single-branch https://github.com/CeresDB/dist-query-testing.git +fi ## build tsbs bins cd tsbs go build ./cmd/tsbs_generate_data @@ -71,4 +89,4 @@ ${CURR_DIR}/tsbs/tsbs_load_ceresdb --ceresdb-addr=${CERESDB_ADDR} --file ${DATA_ # Run queries against ceresdb # TODO: support more kinds of queries besides 5-8-1. -cat ${BULK_DATA_DIR}/single-groupby-5-8-1-queries.gz | gunzip | ${CURR_DIR}/tsbs/tsbs_run_queries_ceresdb --ceresdb-addr=${CERESDB_ADDR} --print-responses true --access-mode proxy --responses-file ${QUERY_RESPONSE_FILE} | tee ${LOG_DIR}/5-8-1.log +cat ${BULK_DATA_DIR}/single-groupby-5-8-1-queries.gz | gunzip | ${CURR_DIR}/tsbs/tsbs_run_queries_ceresdb --ceresdb-addr=${CERESDB_ADDR} --print-responses true --access-mode proxy --responses-file ${QUERY_RESULTS_FILE} | tee ${LOG_DIR}/5-8-1.log