Skip to content

Commit ef872d8

Browse files
authored
chore: add support for running module dir tests in continuous (#8735)
This allows to more easily invoke tests for particualar modules.
1 parent 2105434 commit ef872d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/kokoro/continuous.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ if [[ $KOKORO_JOB_NAME == *"continuous"* ]]; then
161161
# CHANGED_DIRS is the list of significant top-level directories that changed,
162162
# but weren't deleted by the current PR. CHANGED_DIRS will be empty when run on main.
163163
CHANGED_DIRS=$(echo "$SIGNIFICANT_CHANGES" | tr ' ' '\n' | grep "/" | cut -d/ -f1 | sort -u | tr '\n' ' ' | xargs ls -d 2>/dev/null || true)
164+
if [[ -n $TARGET_MODULE ]]; then
165+
pushd $TARGET_MODULE > /dev/null;
166+
runDirectoryTests
167+
popd > /dev/null
168+
elif [[ -z $SIGNIFICANT_CHANGES ]] || echo "$SIGNIFICANT_CHANGES" | tr ' ' '\n' | grep "^go.mod$" || [[ $CHANGED_DIRS =~ "internal" ]]; then
164169
# If PR changes affect all submodules, then run all tests.
165-
if [[ -z $SIGNIFICANT_CHANGES ]] || echo "$SIGNIFICANT_CHANGES" | tr ' ' '\n' | grep "^go.mod$" || [[ $CHANGED_DIRS =~ "internal" ]]; then
166170
testAllModules
167171
else
168172
runDirectoryTests . # Always run base tests.

0 commit comments

Comments
 (0)