diff --git a/tests/mooncake-ci-test/install.sh b/tests/mooncake-ci-test/install.sh index b37c7528ed13d3161ea29b3da135a3ccc7d51d47..2b03a227b214324c5ad375016dda9d892bfe8e4d 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 -v "${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