From 53f0473f18dde254d8937b726d79e224ac6c7b3c Mon Sep 17 00:00:00 2001 From: shicanwei Date: Thu, 26 Mar 2026 14:19:55 +0800 Subject: [PATCH 1/2] Skip applying PR patch if no changes detected in scripts/tone_tests/ Signed-off-by: shicanwei --- tests/mooncake-ci-test/install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/mooncake-ci-test/install.sh b/tests/mooncake-ci-test/install.sh index b37c752..e70a436 100644 --- a/tests/mooncake-ci-test/install.sh +++ b/tests/mooncake-ci-test/install.sh @@ -47,13 +47,18 @@ extract_src() patch_file="${TONE_BM_BUILD_DIR}/pr-${PR_ID}.patch" if curl --fail -L -o "${patch_file}" "${patch_url}"; then - cd "${TONE_BM_BUILD_DIR}/Mooncake" - git apply "${patch_file}" - if [ $? -ne 0 ]; then - echo "ERROR: Failed to apply patch from ${patch_url}" - exit 1 + if grep -q "^diff --git a/scripts/tone_tests/" "${patch_file}"; then + echo "Patch contains changes to scripts/tone_tests/, applying..." + cd "${TONE_BM_BUILD_DIR}/Mooncake" + git apply "${patch_file}" + if [ $? -ne 0 ]; then + echo "ERROR: Failed to apply patch from ${patch_url}" + exit 1 + fi + cd - > /dev/null + else + echo "Patch does not contain changes to scripts/tone_tests/, skipping..." fi - cd - > /dev/null else echo "ERROR: Failed to download patch from ${patch_url}" exit 1 -- Gitee From b828f954f40bdb040c0ca797546894f4e718f91d Mon Sep 17 00:00:00 2001 From: shicanwei Date: Thu, 26 Mar 2026 15:00:31 +0800 Subject: [PATCH 2/2] add git apply -v Signed-off-by: shicanwei --- tests/mooncake-ci-test/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mooncake-ci-test/install.sh b/tests/mooncake-ci-test/install.sh index e70a436..2b03a22 100644 --- a/tests/mooncake-ci-test/install.sh +++ b/tests/mooncake-ci-test/install.sh @@ -50,7 +50,7 @@ extract_src() if grep -q "^diff --git a/scripts/tone_tests/" "${patch_file}"; then echo "Patch contains changes to scripts/tone_tests/, applying..." cd "${TONE_BM_BUILD_DIR}/Mooncake" - git apply "${patch_file}" + git apply -v "${patch_file}" if [ $? -ne 0 ]; then echo "ERROR: Failed to apply patch from ${patch_url}" exit 1 -- Gitee