forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-ut.sh
executable file
·225 lines (194 loc) · 6.75 KB
/
run-ut.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -eo pipefail
ROOT=`dirname "$0"`
ROOT=`cd "$ROOT"; pwd`
export DORIS_HOME=${ROOT}
. ${DORIS_HOME}/env.sh
PARALLEL=$[$(nproc)/4+1]
# Check args
usage() {
echo "
Usage: $0 <options>
Optional options:
--clean clean and build ut
--run build and run ut
Eg.
$0 build ut
$0 --run build and run ut
$0 --clean clean and build ut
$0 --clean --run clean, build and run ut
"
exit 1
}
OPTS=$(getopt \
-n $0 \
-o '' \
-l 'run' \
-l 'clean' \
-- "$@")
if [ $? != 0 ] ; then
usage
fi
eval set -- "$OPTS"
CLEAN=
RUN=
if [ $# == 1 ] ; then
#default
CLEAN=0
RUN=0
else
CLEAN=0
RUN=0
while true; do
case "$1" in
--clean) CLEAN=1 ; shift ;;
--run) RUN=1 ; shift ;;
--) shift ; break ;;
*) ehco "Internal error" ; exit 1 ;;
esac
done
fi
echo "Build Backend UT"
if [ ${CLEAN} -eq 1 ]; then
rm ${DORIS_HOME}/be/build/ -rf
rm ${DORIS_HOME}/be/output/ -rf
fi
if [ ! -d ${DORIS_HOME}/be/build ]; then
mkdir -p ${DORIS_HOME}/be/build/
fi
cd ${DORIS_HOME}/be/build/
cmake ../ -DMAKE_TEST=ON
make -j${PARALLEL}
if [ ${RUN} -ne 1 ]; then
echo "Finished"
exit 0
fi
echo "******************************"
echo " Runing PaloBe Unittest "
echo "******************************"
cd ${DORIS_HOME}
export DORIS_TEST_BINARY_DIR=${DORIS_HOME}/be/build
export TERM=xterm
export UDF_RUNTIME_DIR=${DORIS_HOME}/lib/udf-runtime
export LOG_DIR=${DORIS_HOME}/log
for i in `sed 's/ //g' $DORIS_HOME/conf/be.conf | egrep "^[[:upper:]]([[:upper:]]|_|[[:digit:]])*="`; do
eval "export $i";
done
mkdir -p $LOG_DIR
mkdir -p ${UDF_RUNTIME_DIR}
rm -f ${UDF_RUNTIME_DIR}/*
if [ ${RUN} -ne 1 ]; then
echo "Finished"
exit 0
fi
echo "******************************"
echo " Runing PaloBe Unittest "
echo "******************************"
export DORIS_TEST_BINARY_DIR=${DORIS_TEST_BINARY_DIR}/test/
# prepare util test_data
if [ -d ${DORIS_TEST_BINARY_DIR}/util/test_data ]; then
rm -rf ${DORIS_TEST_BINARY_DIR}/util/test_data
fi
cp -r ${DORIS_HOME}/be/test/util/test_data ${DORIS_TEST_BINARY_DIR}/util/
# Running Util Unittest
${DORIS_TEST_BINARY_DIR}/util/bit_util_test
${DORIS_TEST_BINARY_DIR}/util/path_trie_test
${DORIS_TEST_BINARY_DIR}/util/count_down_latch_test
${DORIS_TEST_BINARY_DIR}/util/lru_cache_util_test
${DORIS_TEST_BINARY_DIR}/util/filesystem_util_test
${DORIS_TEST_BINARY_DIR}/util/internal_queue_test
${DORIS_TEST_BINARY_DIR}/util/cidr_test
${DORIS_TEST_BINARY_DIR}/util/new_metrics_test
${DORIS_TEST_BINARY_DIR}/util/doris_metrics_test
${DORIS_TEST_BINARY_DIR}/util/system_metrics_test
${DORIS_TEST_BINARY_DIR}/util/core_local_test
${DORIS_TEST_BINARY_DIR}/util/arena_test
${DORIS_TEST_BINARY_DIR}/util/types_test
${DORIS_TEST_BINARY_DIR}/util/json_util_test
${DORIS_TEST_BINARY_DIR}/util/byte_buffer_test2
${DORIS_TEST_BINARY_DIR}/util/uid_util_test
${DORIS_TEST_BINARY_DIR}/util/aes_util_test
${DORIS_TEST_BINARY_DIR}/util/string_util_test
## Running common Unittest
${DORIS_TEST_BINARY_DIR}/common/resource_tls_test
## Running exec unit test
${DORIS_TEST_BINARY_DIR}/exec/plain_text_line_reader_uncompressed_test
${DORIS_TEST_BINARY_DIR}/exec/plain_text_line_reader_gzip_test
${DORIS_TEST_BINARY_DIR}/exec/plain_text_line_reader_bzip_test
${DORIS_TEST_BINARY_DIR}/exec/plain_text_line_reader_lz4frame_test
${DORIS_TEST_BINARY_DIR}/exec/plain_text_line_reader_lzop_test
${DORIS_TEST_BINARY_DIR}/exec/broker_scanner_test
${DORIS_TEST_BINARY_DIR}/exec/broker_scan_node_test
${DORIS_TEST_BINARY_DIR}/exec/es_scan_node_test
${DORIS_TEST_BINARY_DIR}/exec/olap_table_info_test
${DORIS_TEST_BINARY_DIR}/exec/olap_table_sink_test
## Running runtime Unittest
${DORIS_TEST_BINARY_DIR}/runtime/fragment_mgr_test
${DORIS_TEST_BINARY_DIR}/runtime/decimal_value_test
${DORIS_TEST_BINARY_DIR}/runtime/datetime_value_test
${DORIS_TEST_BINARY_DIR}/runtime/large_int_value_test
${DORIS_TEST_BINARY_DIR}/runtime/string_value_test
${DORIS_TEST_BINARY_DIR}/runtime/free_list_test
${DORIS_TEST_BINARY_DIR}/runtime/string_buffer_test
${DORIS_TEST_BINARY_DIR}/runtime/stream_load_pipe_test
${DORIS_TEST_BINARY_DIR}/runtime/tablet_writer_mgr_test
${DORIS_TEST_BINARY_DIR}/runtime/snapshot_loader_test
${DORIS_TEST_BINARY_DIR}/runtime/user_function_cache_test
## Running expr Unittest
# Running http
${DORIS_TEST_BINARY_DIR}/http/metrics_action_test
${DORIS_TEST_BINARY_DIR}/http/http_utils_test
${DORIS_TEST_BINARY_DIR}/http/stream_load_test
${DORIS_TEST_BINARY_DIR}/http/http_client_test
# Running OLAPEngine Unittest
${DORIS_TEST_BINARY_DIR}/olap/bit_field_test
${DORIS_TEST_BINARY_DIR}/olap/byte_buffer_test
${DORIS_TEST_BINARY_DIR}/olap/run_length_byte_test
${DORIS_TEST_BINARY_DIR}/olap/run_length_integer_test
${DORIS_TEST_BINARY_DIR}/olap/stream_index_test
${DORIS_TEST_BINARY_DIR}/olap/lru_cache_test
${DORIS_TEST_BINARY_DIR}/olap/bloom_filter_test
${DORIS_TEST_BINARY_DIR}/olap/bloom_filter_index_test
${DORIS_TEST_BINARY_DIR}/olap/row_block_test
${DORIS_TEST_BINARY_DIR}/olap/comparison_predicate_test
${DORIS_TEST_BINARY_DIR}/olap/in_list_predicate_test
${DORIS_TEST_BINARY_DIR}/olap/null_predicate_test
${DORIS_TEST_BINARY_DIR}/olap/file_helper_test
${DORIS_TEST_BINARY_DIR}/olap/file_utils_test
${DORIS_TEST_BINARY_DIR}/olap/delete_handler_test
${DORIS_TEST_BINARY_DIR}/olap/column_reader_test
${DORIS_TEST_BINARY_DIR}/olap/row_cursor_test
${DORIS_TEST_BINARY_DIR}/olap/skiplist_test
${DORIS_TEST_BINARY_DIR}/olap/serialize_test
${DORIS_TEST_BINARY_DIR}/olap/olap_header_manager_test
${DORIS_TEST_BINARY_DIR}/olap/olap_meta_test
${DORIS_TEST_BINARY_DIR}/olap/delta_writer_test
## Running agent unittest
# Prepare agent testdata
if [ -d ${DORIS_TEST_BINARY_DIR}/agent/test_data ]; then
rm -rf ${DORIS_TEST_BINARY_DIR}/agent/test_data
fi
cp -r ${DORIS_HOME}/be/test/agent/test_data ${DORIS_TEST_BINARY_DIR}/agent/
cd ${DORIS_TEST_BINARY_DIR}/agent
# ./agent_server_test
# ./file_downloader_test
#./heartbeat_server_test
#./pusher_test
./utils_test
#./task_worker_pool_test