-
Notifications
You must be signed in to change notification settings - Fork 6k
Check added ut on windows #31826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check added ut on windows #31826
Changes from 19 commits
d43d75a
d840049
71f36ec
ef75c54
ab2c22f
127d092
f1e607a
7e36c97
8239825
fc39a9d
25f7b43
886591b
68189a3
94603b3
54d5e29
354807b
e81f78f
9dd54f6
95f4c10
290f5ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,32 +16,66 @@ | |
|
|
||
| set +e | ||
| set -x | ||
| SYSTEM=`uname -s` | ||
| if [ -z ${BRANCH} ]; then | ||
| BRANCH="develop" | ||
| fi | ||
|
|
||
| export CI_SKIP_CPP_TEST=OFF | ||
| PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )" | ||
| if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then | ||
| PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )" | ||
| elif [[ "$SYSTEM" == "Windows_NT" ]];then | ||
| PADDLE_ROOT="$(cd "$PWD/../" && pwd )" | ||
| fi | ||
| CURDIR=`pwd` | ||
| cd $PADDLE_ROOT | ||
| cp $PADDLE_ROOT/paddle/scripts/paddle_build.sh $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh | ||
| if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then | ||
| cp $PADDLE_ROOT/paddle/scripts/paddle_build.sh $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh | ||
| elif [[ "$SYSTEM" == "Windows_NT" ]];then | ||
| git remote | grep upstream | ||
| if [ $? != 0 ]; then | ||
| git remote add upstream https://github.com/PaddlePaddle/Paddle.git | ||
| git fetch upstream develop | ||
| fi | ||
| fi | ||
| CURBRANCH=`git rev-parse --abbrev-ref HEAD` | ||
| echo $CURBRANCH | ||
| if [ `git branch | grep 'prec_added_ut'` ];then | ||
| git branch -D 'prec_added_ut' | ||
| fi | ||
| git checkout -b prec_added_ut upstream/${BRANCH} | ||
| git branch | ||
| mkdir prec_build | ||
| cd prec_build | ||
| bash $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh cmake_gen_in_current_dir >prebuild.log 2>&1 | ||
| ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' > /$PADDLE_ROOT/br-ut | ||
| if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then | ||
| bash $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh cmake_gen_in_current_dir >prebuild.log 2>&1 | ||
| elif [[ "$SYSTEM" == "Windows_NT" ]];then | ||
| bash $PADDLE_ROOT/win_cmake.sh | ||
| fi | ||
| ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' | grep 'test' > $PADDLE_ROOT/br-ut | ||
| cd $PADDLE_ROOT/build | ||
| ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' > /$PADDLE_ROOT/pr-ut | ||
| ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' | grep 'test' > $PADDLE_ROOT/pr-ut | ||
| cd $PADDLE_ROOT | ||
| echo "=================================" | ||
| echo "br-ut" | ||
| cat $PADDLE_ROOT/br-ut | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. br-ut的作用是
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. br-ut是为了获取upstream/develop分支上的单测,br-ut和pr-ut对比可以得到新增单测的名称 |
||
| echo "=================================" | ||
| echo "pr-ut" | ||
| cat $PADDLE_ROOT/pr-ut | ||
| echo "=================================" | ||
| grep -F -x -v -f br-ut pr-ut > $PADDLE_ROOT/added_ut | ||
| sort pr-ut |uniq -d > $PADDLE_ROOT/duplicate_ut | ||
| if [[ "$SYSTEM" == 'Linux' ]];then | ||
| sort pr-ut |uniq -d > $PADDLE_ROOT/duplicate_ut | ||
| fi | ||
| echo "New-UT:" | ||
| cat $PADDLE_ROOT/added_ut | ||
| rm -rf prec_build | ||
| rm $PADDLE_ROOT/br-ut $PADDLE_ROOT/pr-ut $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh | ||
| git checkout $CURBRANCH | ||
| if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then | ||
| rm $PADDLE_ROOT/br-ut $PADDLE_ROOT/pr-ut $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh | ||
| elif [[ "$SYSTEM" == "Windows_NT" ]];then | ||
| rm $PADDLE_ROOT/br-ut $PADDLE_ROOT/pr-ut $PADDLE_ROOT/get_added_ut.sh | ||
| fi | ||
| git checkout -f $CURBRANCH | ||
| echo $CURBRANCH | ||
| git branch -D prec_added_ut | ||
| cd $CURDIR | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,14 @@ else | |
| disable_ut_quickly='' | ||
| fi | ||
|
|
||
| # check added ut | ||
| set +e | ||
| cp $PADDLE_ROOT/tools/check_added_ut.sh $PADDLE_ROOT/tools/check_added_ut_win.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个一定需要先cp吗 可以直接执行吗
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
| bash $PADDLE_ROOT/tools/check_added_ut_win.sh | ||
| rm -rf $PADDLE_ROOT/tools/check_added_ut_win.sh | ||
| set -e | ||
|
|
||
|
|
||
| # /*==================Fixed Disabled Windows unittests==============================*/ | ||
| # TODO: fix these unittest that is bound to fail | ||
| diable_wingpu_test="^lite_mul_model_test$|\ | ||
|
|
@@ -378,7 +386,29 @@ function show_ut_retry_result() { | |
|
|
||
| set +e | ||
|
|
||
|
|
||
| if [ -f "$PADDLE_ROOT/added_ut" ];then | ||
| added_uts=^$(awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' $PADDLE_ROOT/added_ut)$ | ||
| ctest -R "(${added_uts})" --output-on-failure -C Release --repeat-until-fail 3;added_ut_error=$? | ||
| if [ "$added_ut_error" != 0 ];then | ||
|
||
| echo "========================================" | ||
| echo "Added UT should pass three additional executions" | ||
| echo "========================================" | ||
| exit 8; | ||
| fi | ||
| fi | ||
|
|
||
| if [ "${WITH_GPU:-OFF}" == "ON" ];then | ||
| if [ -f "$PADDLE_ROOT/added_ut" ];then | ||
| added_uts=^$(awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' $PADDLE_ROOT/added_ut)$ | ||
| ctest -R "(${added_uts})" --output-on-failure -C Release --repeat-until-fail 3;added_ut_error=$? | ||
| if [ "$added_ut_error" != 0 ];then | ||
| echo "========================================" | ||
| echo "Added UT should pass three additional executions" | ||
| echo "========================================" | ||
| exit 8; | ||
| fi | ||
| fi | ||
| run_unittest_gpu $cpu_parallel_job 12 | ||
| run_unittest_gpu $tetrad_parallel_job 4 | ||
| run_unittest_gpu $two_parallel_job 2 | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是叫win_cmake.sh更合适些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我修改一下