From c25beda447e3d0d6d610348107bd513b4bfacf49 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Tue, 19 Aug 2025 11:34:38 +0800 Subject: [PATCH 1/2] [Infra] Fix is_run_distribute_in_op_test when meet file delete --- ci/coverage_test.sh | 8 ++++++-- paddle/scripts/paddle_build.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ci/coverage_test.sh b/ci/coverage_test.sh index 560506a87dfcb4..bc3d6357877ab8 100644 --- a/ci/coverage_test.sh +++ b/ci/coverage_test.sh @@ -24,10 +24,14 @@ function is_run_distribute_in_op_test() { echo "export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1" >> "$HOME/.bashrc" fi done - ALL_CHANGE_FILES=`git diff --numstat upstream/$BRANCH | awk '{print $3}' | grep ".py"|| true` + ALL_CHANGE_FILES=$(git diff --name-only upstream/$BRANCH | grep ".py"|| true) echo ${ALL_CHANGE_FILES} for CHANGE_FILE in ${ALL_CHANGE_FILES}; do - ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH ${PADDLE_ROOT}/${CHANGE_FILE} | grep "+" | grep "check_auto_parallel=" || true` + TARGET_FILE="${PADDLE_ROOT}/${CHANGE_FILE}" + if [ ! -f "$TARGET_FILE" ]; then + continue + fi + ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH "TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` if [ "${ALL_OPTEST_BAN_AUTO_PARALLEL_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1 echo "export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1" >> "$HOME/.bashrc" diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 4f608d228276a4..78f342c23831a0 100644 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -3288,10 +3288,14 @@ function is_run_distribute_in_op_test() { export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1 fi done - ALL_CHANGE_FILES=`git diff --numstat upstream/$BRANCH | awk '{print $3}' | grep ".py"|| true` + ALL_CHANGE_FILES=$(git diff --name-only upstream/$BRANCH | grep ".py"|| true) echo ${ALL_CHANGE_FILES} for CHANGE_FILE in ${ALL_CHANGE_FILES}; do - ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH ${PADDLE_ROOT}/${CHANGE_FILE} | grep "+" | grep "check_auto_parallel=" || true` + TARGET_FILE="${PADDLE_ROOT}/${CHANGE_FILE}" + if [ ! -f "$TARGET_FILE" ]; then + continue + fi + ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH "$TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` if [ "${ALL_OPTEST_BAN_AUTO_PARALLEL_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1 fi From 904c6d95b3ef59fa8828860c4236354bbae98860 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Fri, 22 Aug 2025 06:55:06 +0800 Subject: [PATCH 2/2] fix typos --- ci/coverage_test.sh | 2 +- paddle/scripts/paddle_build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/coverage_test.sh b/ci/coverage_test.sh index bc3d6357877ab8..dfd9abca4fac67 100644 --- a/ci/coverage_test.sh +++ b/ci/coverage_test.sh @@ -31,7 +31,7 @@ function is_run_distribute_in_op_test() { if [ ! -f "$TARGET_FILE" ]; then continue fi - ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH "TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` + ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH -- "$TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` if [ "${ALL_OPTEST_BAN_AUTO_PARALLEL_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1 echo "export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1" >> "$HOME/.bashrc" diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 78f342c23831a0..8ed7773762c229 100644 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -3295,7 +3295,7 @@ function is_run_distribute_in_op_test() { if [ ! -f "$TARGET_FILE" ]; then continue fi - ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH "$TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` + ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH -- "$TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true` if [ "${ALL_OPTEST_BAN_AUTO_PARALLEL_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1 fi