Skip to content

Commit f57ae4d

Browse files
authored
[cherry-pick] use the required instruction to determine if the environment fits the sample code's required. (#32766) (#33451)
1 put a instruction # required: gpu(for example) in the sample code 2 this piece of code will only run in the GPU-equipped CI pipelines, and be omitted in other pipelines. 3 the CI pipelines can specify its capacity by shell environment variable SAMPLE_CODE_TEST_CAPACITY 2.1 文档改版方案 see #32766 for more infomation
1 parent 61cae0d commit f57ae4d

File tree

4 files changed

+661
-745
lines changed

4 files changed

+661
-745
lines changed

tools/check_file_diff_approvals.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ API_FILES=("CMakeLists.txt"
5252
"python/paddle/fluid/tests/unittests/white_list/op_threshold_white_list.py"
5353
"python/paddle/fluid/tests/unittests/white_list/check_op_sequence_batch_1_input_white_list.py"
5454
"python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py"
55-
"tools/wlist.json"
55+
"tools/print_signatures.py"
5656
"tools/sampcd_processor.py"
5757
"paddle/scripts/paddle_build.bat"
5858
"tools/windows/run_unittests.sh"
@@ -80,11 +80,10 @@ function add_failed(){
8080
echo_list="${echo_list[@]}$1"
8181
}
8282

83-
function run_test_sampcd_processor() {
83+
function run_tools_test() {
8484
CUR_PWD=$(pwd)
8585
cd ${PADDLE_ROOT}/tools
86-
python test_sampcd_processor.py
87-
python test_print_signatures.py
86+
python $1
8887
cd ${CUR_PWD}
8988
}
9089

@@ -141,12 +140,12 @@ for API_FILE in ${API_FILES[*]}; do
141140
elif [ "${API_FILE}" == "python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py" ];then
142141
echo_line="You must have one RD (Shixiaowei02 (Recommend), luotao1 or phlrain) approval for the python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py, which manages the white list of no_grad_set without value in operators. For more information, please refer to[https://github.com/PaddlePaddle/Paddle/wiki/It's-recommend-to-set-no_grad_set-to-be-None].\n"
143142
check_approval 1 39303645 6836917 43953930
144-
elif [ "${API_FILE}" == "tools/wlist.json" ];then
145-
echo_line="You must have one TPM (jzhang533) approval for the api whitelist for the tools/wlist.json.\n"
146-
check_approval 1 29231
147143
elif [ "${API_FILE}" == "tools/sampcd_processor.py" ];then
148144
echo_line="test_sampcd_processor.py will be executed for changed sampcd_processor.py.\n"
149-
run_test_sampcd_processor
145+
run_tools_test test_sampcd_processor.py
146+
elif [ "${API_FILE}" == "tools/print_signatures.py" ];then
147+
echo_line="test_print_signatures.py will be executed for changed print_signatures.py.\n"
148+
run_tools_test test_print_signatures.py
150149
elif [ "${API_FILE}" == "python/paddle/distributed/fleet/__init__.py" ]; then
151150
echo_line="You must have (fuyinno4 (Recommend), raindrops2sea) approval for ${API_FILE} changes"
152151
check_approval 1 35824027 38231817

0 commit comments

Comments
 (0)