From 95a0916e058913d4cc60668d65f6ed3cfeb198db Mon Sep 17 00:00:00 2001 From: rahul yadav Date: Tue, 28 May 2024 23:08:26 +0530 Subject: [PATCH] run tests on all changed dirs --- internal/kokoro/presubmit.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/kokoro/presubmit.sh b/internal/kokoro/presubmit.sh index 8f14aa2b1689..b7ff0c5be9d5 100755 --- a/internal/kokoro/presubmit.sh +++ b/internal/kokoro/presubmit.sh @@ -90,14 +90,15 @@ fi CHANGED_DIRS=$(echo "$SIGNIFICANT_CHANGES" | tr ' ' '\n' | cut -d/ -f1 | sort -u | tr '\n' ' ' | xargs ls -d 2>/dev/null || true) -# Check if "." is in the list of changed directories, filter other directories if so. -if echo "$CHANGED_DIRS" | grep -qw "\."; then - echo "Detected changes in the root directory, running tests in all submodules" - CHANGED_DIRS="." -fi - echo "Running tests only in changed submodules: $CHANGED_DIRS" for d in $CHANGED_DIRS; do + # Check if "." is in the list of changed directories, which means the root + if [ "$d" = "." ]; then + pushd $(dirname $d) + runPresubmitTests + popd + continue + fi for i in $(find "$d" -name go.mod); do pushd $(dirname $i) runPresubmitTests