Skip to content
Draft
Show file tree
Hide file tree
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
15 changes: 12 additions & 3 deletions .kokoro/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,25 @@ for path in `find 'packages' \
files_to_check=("${package_path}")
fi

echo "checking changes with 'git diff ${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT} -- ${files_to_check[*]}'"
set +e
# Passing the array expanded as arguments to git diff
package_modified=$(git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- "${files_to_check[@]}" | wc -l)
set -e

if [[ "${package_modified}" -gt 0 || "$KOKORO_BUILD_ARTIFACTS_SUBDIR" == *"continuous"* ]]; then
states=()
[[ "${package_modified}" -gt 0 ]] && states+=("changed")
[[ "$KOKORO_BUILD_ARTIFACTS_SUBDIR" == *"continuous"* ]] && states+=("continuous")

# Join states with a comma
state_str=$(IFS=, ; echo "${states[*]}")

commit_hash="${KOKORO_GITHUB_PULL_REQUEST_COMMIT:-HEAD}"

if [[ ${#states[@]} -gt 0 ]]; then
printf "TEST %-20s %-40s %s\n" "[${state_str}]" "${package_name}" "${commit_hash}"
PACKAGES_TO_TEST+=("$package_name")
else
echo "No changes in ${package_name} and not a continuous build, skipping."
printf "SKIP %-20s %-40s %s\n" "[no_changes]" "${package_name}" "${commit_hash}"
fi
done

Expand Down
2 changes: 2 additions & 0 deletions packages/google-cloud-testutils/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2017 Google LLC
# Trigger parallel system test run
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,6 +16,7 @@
import io
import os
import re

import setuptools # type: ignore

version = None
Expand Down
Loading