diff --git a/.kokoro/tests/run_tests.sh b/.kokoro/tests/run_tests.sh index 692bf93e750..6527e8b2469 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 "origin/master..." .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.