未验证 提交 cf6eb0e1 编写于 作者: Z zhangchunle 提交者: GitHub

summary failedtests (#25388)

上级 20ee36bd
...@@ -742,6 +742,23 @@ EOF ...@@ -742,6 +742,23 @@ EOF
fi fi
} }
failed_test_lists=''
tmp_dir=`mktemp -d`
function collect_failed_tests() {
for file in `ls $tmp_dir`; do
exit_code=0
grep -q 'The following tests FAILED:' $tmp_dir/$file||exit_code=$?
if [ $exit_code -ne 0 ]; then
failuretest=''
else
failuretest=`grep -A 10000 'The following tests FAILED:' $tmp_dir/$file | sed 's/The following tests FAILED://g'|sed '/^$/d'`
failed_test_lists="${failed_test_lists}
${failuretest}"
fi
done
}
function card_test() { function card_test() {
set -m set -m
case_count $1 $2 case_count $1 $2
...@@ -764,7 +781,7 @@ function card_test() { ...@@ -764,7 +781,7 @@ function card_test() {
fi fi
trap 'caught_error' CHLD trap 'caught_error' CHLD
tmpfile_rand=`date +%s%N`
NUM_PROC=$[CUDA_DEVICE_COUNT/$cardnumber] NUM_PROC=$[CUDA_DEVICE_COUNT/$cardnumber]
for (( i = 0; i < $NUM_PROC; i++ )); do for (( i = 0; i < $NUM_PROC; i++ )); do
# CUDA_VISIBLE_DEVICES http://acceleware.com/blog/cudavisibledevices-masking-gpus # CUDA_VISIBLE_DEVICES http://acceleware.com/blog/cudavisibledevices-masking-gpus
...@@ -777,21 +794,21 @@ function card_test() { ...@@ -777,21 +794,21 @@ function card_test() {
cuda_list="$cuda_list,$[i*cardnumber+j]" cuda_list="$cuda_list,$[i*cardnumber+j]"
fi fi
done done
tmpfile=$tmp_dir/$tmpfile_rand"_"$i
if [ ${TESTING_DEBUG_MODE:-OFF} == "ON" ] ; then if [ ${TESTING_DEBUG_MODE:-OFF} == "ON" ] ; then
if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then
ctest -I $i,,$NUM_PROC -R "($testcases)" -V & (ctest -I $i,,$NUM_PROC -R "($testcases)" -V | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
else else
env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -V & (env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" -V | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
fi fi
else else
if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then if [[ $cardnumber == $CUDA_DEVICE_COUNT ]]; then
ctest -I $i,,$NUM_PROC -R "($testcases)" --output-on-failure & (ctest -I $i,,$NUM_PROC -R "($testcases)" --output-on-failure | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
else else
env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" --output-on-failure & (env CUDA_VISIBLE_DEVICES=$cuda_list ctest -I $i,,$NUM_PROC -R "($testcases)" --output-on-failure | tee $tmpfile; test ${PIPESTATUS[0]} -eq 0) &
fi fi
fi fi
done done
wait; # wait for all subshells to finish wait; # wait for all subshells to finish
ut_endTime_s=`date +%s` ut_endTime_s=`date +%s`
if [ "$2" == "" ]; then if [ "$2" == "" ]; then
...@@ -876,6 +893,16 @@ set +x ...@@ -876,6 +893,16 @@ set +x
card_test "$single_card_tests_1" 1 # run cases with single GPU card_test "$single_card_tests_1" 1 # run cases with single GPU
card_test "$multiple_card_tests" 2 # run cases with two GPUs card_test "$multiple_card_tests" 2 # run cases with two GPUs
card_test "$exclusive_tests" # run cases exclusively, in this cases would be run with 4/8 GPUs card_test "$exclusive_tests" # run cases exclusively, in this cases would be run with 4/8 GPUs
collect_failed_tests
if [ -n "${failed_test_lists}" ];then
failed_test_lists_ult=`echo "${failed_test_lists}" |grep -Po '[^ ].*$'`
echo "========================================"
echo "Summary Failed Tests... "
echo "========================================"
echo "The following tests FAILED: "
echo "${failed_test_lists_ult}"
fi
rm -f $tmp_dir/*
if [[ "$EXIT_CODE" != "0" ]]; then if [[ "$EXIT_CODE" != "0" ]]; then
exit 8; exit 8;
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册