Skip to content

Commit

Permalink
chore(internal/kokoro): filter changes down to unique dir (#10064)
Browse files Browse the repository at this point in the history
In #9777 there are so many `.go` files being changed that the `internal/kokoro/presubmit.sh` bash scripting was overflowing the conditional check and returning an error. Oddly enough, things would keep going.

We don't really need to check for changes on the `.go` file level if we are just going to run the directory's tests anyways, so let's filter the changes down to unique directory instead.

Ran these commands locally against #9777 and it will fix the bash error we are seeing.
  • Loading branch information
noahdietz authored Apr 29, 2024
1 parent 654e656 commit 0429048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/kokoro/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ runPresubmitTests() {
}

SIGNIFICANT_CHANGES=$(git --no-pager diff --name-only origin/main...$KOKORO_GIT_COMMIT_google_cloud_go |
grep -Ev '(\.md$|^\.github|\.json$|\.yaml$)' || true)
grep -Ev '(\.md$|^\.github|\.json$|\.yaml$)' | xargs dirname | sort -u || true)

if [ -z $SIGNIFICANT_CHANGES ]; then
echo "No changes detected, skipping tests"
Expand Down

0 comments on commit 0429048

Please # to comment.