Skip to content

Commit 9f5108a

Browse files
authored
Add cicheck_brpc (#15468)
1 parent eaad3e4 commit 9f5108a

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ function cmake_gen() {
164164
INFERENCE_DEMO_INSTALL_DIR=${INFERENCE_DEMO_INSTALL_DIR:-/root/.cache/inference_demo}
165165
fi
166166

167+
distibuted_flag=${WITH_DISTRIBUTE:-OFF}
168+
grpc_flag=${WITH_GRPC:-${distibuted_flag}}
169+
167170
cat <<EOF
168171
========================================
169172
Configuring cmake in /paddle/build ...
@@ -173,7 +176,7 @@ function cmake_gen() {
173176
-DWITH_DOC=${WITH_DOC:-OFF}
174177
-DWITH_GPU=${WITH_GPU:-OFF}
175178
-DWITH_AMD_GPU=${WITH_AMD_GPU:-OFF}
176-
-DWITH_DISTRIBUTE=${WITH_DISTRIBUTE:-OFF}
179+
-DWITH_DISTRIBUTE=${distibuted_flag}
177180
-DWITH_MKL=${WITH_MKL:-ON}
178181
-DWITH_NGRAPH=${WITH_NGRAPH:-OFF}
179182
-DWITH_AVX=${WITH_AVX:-OFF}
@@ -194,7 +197,8 @@ function cmake_gen() {
194197
-DANAKIN_BUILD_CROSS_PLANTFORM=${ANAKIN_BUILD_CROSS_PLANTFORM:ON}
195198
-DPY_VERSION=${PY_VERSION:-2.7}
196199
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-/paddle/build}
197-
-DWITH_JEMALLOC=${WITH_JEMALLOC:-OFF}
200+
-DWITH_JEMALLOC=${WITH_JEMALLOC:-OFF}
201+
-DWITH_GRPC=${grpc_flag}
198202
========================================
199203
EOF
200204
# Disable UNITTEST_USE_VIRTUALENV in docker because
@@ -207,7 +211,7 @@ EOF
207211
-DWITH_DOC=${WITH_DOC:-OFF} \
208212
-DWITH_GPU=${WITH_GPU:-OFF} \
209213
-DWITH_AMD_GPU=${WITH_AMD_GPU:-OFF} \
210-
-DWITH_DISTRIBUTE=${WITH_DISTRIBUTE:-OFF} \
214+
-DWITH_DISTRIBUTE=${distibuted_flag} \
211215
-DWITH_MKL=${WITH_MKL:-ON} \
212216
-DWITH_NGRAPH=${WITH_NGRAPH:-OFF} \
213217
-DWITH_AVX=${WITH_AVX:-OFF} \
@@ -227,7 +231,8 @@ EOF
227231
-DANAKIN_BUILD_CROSS_PLANTFORM=${ANAKIN_BUILD_CROSS_PLANTFORM:ON}\
228232
-DPY_VERSION=${PY_VERSION:-2.7} \
229233
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-/paddle/build} \
230-
-DWITH_JEMALLOC=${WITH_JEMALLOC:-OFF}
234+
-DWITH_JEMALLOC=${WITH_JEMALLOC:-OFF} \
235+
-DWITH_GRPC=${grpc_flag}
231236

232237
}
233238

@@ -311,6 +316,45 @@ EOF
311316
fi
312317
}
313318

319+
function run_brpc_test() {
320+
mkdir -p ${PADDLE_ROOT}/build
321+
cd ${PADDLE_ROOT}/build
322+
if [[ ${WITH_TESTING:-ON} == "ON" \
323+
&& ${WITH_DISTRIBUTE:-OFF} == "ON" \
324+
&& ${WITH_GRPC:-OFF} == "OFF" ]] ; then
325+
cat <<EOF
326+
========================================
327+
Running brpc unit tests ...
328+
========================================
329+
EOF
330+
set +x
331+
declare -a other_tests=("test_listen_and_serv_op" "system_allocator_test")
332+
all_tests=`ctest -N`
333+
334+
for t in "${other_tests[@]}"
335+
do
336+
if [[ ${all_tests} != *$t* ]]; then
337+
continue
338+
fi
339+
340+
if [[ ${TESTING_DEBUG_MODE:-OFF} == "ON" ]] ; then
341+
ctest -V -R $t
342+
else
343+
ctest --output-on-failure -R $t
344+
fi
345+
done
346+
set -x
347+
348+
if [[ ${TESTING_DEBUG_MODE:-OFF} == "ON" ]] ; then
349+
ctest -V -R test_dist_*
350+
else
351+
ctest --output-on-failure -R test_dist_*
352+
fi
353+
fi
354+
}
355+
356+
357+
314358
function run_mac_test() {
315359
mkdir -p ${PADDLE_ROOT}/build
316360
cd ${PADDLE_ROOT}/build
@@ -788,6 +832,11 @@ function main() {
788832
test_fluid_lib
789833
assert_api_spec_approvals
790834
;;
835+
cicheck_brpc)
836+
cmake_gen ${PYTHON_ABI:-""}
837+
build
838+
run_brpc_test
839+
;;
791840
assert_api)
792841
assert_api_not_changed ${PYTHON_ABI:-""}
793842
assert_api_spec_approvals

0 commit comments

Comments
 (0)