Skip to content

Commit

Permalink
[ci](test) support run doris sql convertor cases
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen committed Jul 29, 2024
1 parent 55c5524 commit a94d502
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions regression-test/pipeline/cloud_p0/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ exit_flag=0
if ! prepare_java_udf; then exit 1; fi
if ! start_doris_fe; then exit 1; fi
if ! start_doris_be; then exit 1; fi
if ! deploy_doris_sql_convertor; then exit 1; fi
if ! check_doris_ready; then exit 1; fi

echo "#### 5. set session variables"
Expand Down
33 changes: 33 additions & 0 deletions regression-test/pipeline/common/doris-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,39 @@ function install_fdb() {
fi
}

deploy_doris_sql_convertor() {
# https://doris.apache.org/zh-CN/docs/dev/lakehouse/sql-dialect/
if [[ -n "$1" ]]; then
download_url="$1"
elif [[ -n "${doris_sql_convertor_download_url}" ]]; then
download_url="${doris_sql_convertor_download_url}"
else
download_url="https://selectdb-doris.oss-cn-beijing.aliyuncs.com/doris-sql-convertor/doris-sql-convertor-1.0.6-bin-x86.tar.gz"
fi
if wget -c -t3 -q "${download_url}"; then
download_file_name="$(basename "${download_url}")"
extract_dir_name="doris_sql_convertor"
mkdir -p "${extract_dir_name}"
tar -xf "${download_file_name}" --strip-components 1 -C "${extract_dir_name}"
if [[ ! -f "${extract_dir_name}"/conf/config.conf ]]; then
echo "ERROR: miss file ${extract_dir_name}/conf/config.conf" && return 1
fi
doris_sql_convertor_port="${doris_sql_convertor_port:-5001}"
sed -i "/port=.*/d" "${extract_dir_name}"/conf/config.conf
echo "port=${doris_sql_convertor_port}" >>"${extract_dir_name}"/conf/config.conf
echo "INFO: changed doris-sql-convertor port to ${doris_sql_convertor_port}"
if bash "${extract_dir_name}"/bin/stop.sh && fuser -k 5002/tcp; then echo; fi
if bash "${extract_dir_name}"/bin/start.sh &&
sleep 2s && lsof -i:"${doris_sql_convertor_port}"; then
echo "INFO: doris-sql-convertor start success."
else
echo "ERROR: doris-sql-convertor start failed." && return 1
fi
else
echo "ERROR: download doris-sql-convertor(${download_url}) failed." && return 1
fi
}

function restart_doris() {
if stop_doris; then echo; fi
if ! start_doris_fe; then return 1; fi
Expand Down
3 changes: 1 addition & 2 deletions regression-test/pipeline/p0/conf/regression-conf.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ excludeDirectories = "000_the_start_sentinel_do_not_touch," + // keep this line
"cloud_p0," +
"nereids_rules_p0/subquery," +
"workload_manager_p1," +
"zzz_the_end_sentinel_do_not_touch," +
"dialect_compatible"// keep this line as the last line
"zzz_the_end_sentinel_do_not_touch"// keep this line as the last line

customConf1 = "test_custom_conf_value"

Expand Down

0 comments on commit a94d502

Please sign in to comment.