From 0e77f3fd36f5152471a491a2a0a3bf588e0ee656 Mon Sep 17 00:00:00 2001 From: kurtisvg <31518063+kurtisvg@users.noreply.github.com> Date: Fri, 29 May 2020 15:16:52 -0700 Subject: [PATCH 1/2] Update diff-master to check .kokoro/tests and .kokoro/docker. --- .kokoro/tests/run_tests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.kokoro/tests/run_tests.sh b/.kokoro/tests/run_tests.sh index 692bf93e750..c6975b3c480 100755 --- a/.kokoro/tests/run_tests.sh +++ b/.kokoro/tests/run_tests.sh @@ -22,9 +22,15 @@ shopt -s globstar DIFF_FROM="" -# `--only-diff-master will only run tests on project changes from the master branch. +# `--only-diff-master will only run tests on project changes on the last common commit from the master branch. if [[ $* == *--only-diff-master* ]]; then - DIFF_FROM="origin/master.." + git diff --quiet "$DIFF_FROM" .kokoro/tests .kokoro/docker + CHANGED=$? + if [[ "$CHANGED" -eq 0 ]]; then + DIFF_FROM="origin/master..." + else + echo "Changes to .kokoro/test or .kokoro docker detected. Running full tests." + fi fi # `--only-diff-master will only run tests on project changes from the previous commit. From 12409f2fc4caa81aebaf7685de1ceebab2259dc7 Mon Sep 17 00:00:00 2001 From: kurtisvg <31518063+kurtisvg@users.noreply.github.com> Date: Fri, 29 May 2020 15:17:57 -0700 Subject: [PATCH 2/2] Don't use DIFF_FROM for first check. --- .kokoro/tests/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/tests/run_tests.sh b/.kokoro/tests/run_tests.sh index c6975b3c480..6527e8b2469 100755 --- a/.kokoro/tests/run_tests.sh +++ b/.kokoro/tests/run_tests.sh @@ -24,7 +24,7 @@ DIFF_FROM="" # `--only-diff-master will only run tests on project changes on the last common commit from the master branch. if [[ $* == *--only-diff-master* ]]; then - git diff --quiet "$DIFF_FROM" .kokoro/tests .kokoro/docker + git diff --quiet "origin/master..." .kokoro/tests .kokoro/docker CHANGED=$? if [[ "$CHANGED" -eq 0 ]]; then DIFF_FROM="origin/master..."