Skip to content

Update presubmit tests to run full tests if .kokoro/tests or .kokoro/docker have changed. #3915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down