Skip to content

Commit d382c47

Browse files
chingor13sduskis
authored andcommitted
---
yaml --- r: 20683 b: refs/heads/autosynth-iamcredentials c: f27d35d h: refs/heads/master i: 20681: 0b0f7ac 20679: f070b6f
1 parent 5976a4f commit d382c47

4 files changed

Lines changed: 48 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ refs/heads/pubsub-ordering-keys: 858d4e986a0ba48e08f00d42f51cbdecb175f5d6
162162
refs/tags/v0.75.0: c3673089ae09a897c1b4cf7dfe167fe4f8ab32fb
163163
refs/tags/v0.76.0: 395b016826d3ddf9cb8b34919636df15a4dbd032
164164
refs/tags/v0.77.0: 28a85a77883ccf5d48f297fd0ef3b3dca6ce01f0
165-
refs/heads/autosynth-iamcredentials: d889bb0d5635749c0bc818c3caf72a953d32410f
165+
refs/heads/autosynth-iamcredentials: f27d35d5f51ccaf06f12084dbc75f332626ffe56
166166
refs/heads/release-google-cloud-java-v0.78.0: fae5e980779cf0173a152636b278015b9f60ee55
167167
refs/heads/release-google-cloud-java-v0.81.0: 0352cd0dd11f4fd1fbd1ff16e7a96beaccc7b475
168168
refs/heads/release-google-cloud-java-v0.81.1-SNAPSHOT: 5a74ccb1f12506a3b67b65521881298fde20bd6f

branches/autosynth-iamcredentials/.kokoro/build.sh

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,44 @@ set -eo pipefail
1717

1818
cd github/google-cloud-java/
1919

20+
function client_has_changes() {
21+
CLIENT_NAME=$1
22+
if [[ ! -z $(git diff master google-cloud-clients/google-cloud-core*) ]]; then
23+
echo "true"
24+
return
25+
fi
26+
27+
if [[ ! -z $(git diff master google-cloud-clients/${CLIENT_NAME}) ]]; then
28+
echo "true"
29+
return
30+
fi
31+
32+
if [[ ! -z $(git diff master google-api-grpc/*${CLIENT_NAME}*) ]]; then
33+
echo "true"
34+
return
35+
fi
36+
37+
echo "false"
38+
}
39+
2040
# Print out Java version
2141
java -version
2242
echo $JOB_TYPE
2343

44+
if [[ "${SKIP_INTEGRATION_TESTS_IF_NO_CHANGES}" == "true" ]] &&
45+
[[ "${JOB_TYPE}" == "integration" ]]; then
46+
CLIENT=$(echo ${INTEGRATION_TEST_ARGS} | cut -d' ' -f1 | cut -d'/' -f2)
47+
CLIENT_HAS_CHANGES=$(client_has_changes ${CLIENT})
48+
if [[ "${CLIENT_HAS_CHANGES}" == "false" ]]; then
49+
echo "No difference from master, skipping tests."
50+
exit 0
51+
fi
52+
fi
53+
2454
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V
2555

2656
# prepend Kokoro root directory onto GOOGLE_APPLICATION_CREDENTIALS path
27-
if [ ! -z "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
57+
if [[ ! -z "$GOOGLE_APPLICATION_CREDENTIALS" ]]; then
2858
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS})
2959
fi
3060

branches/autosynth-iamcredentials/.kokoro/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ env_vars: {
1111
key: "TRAMPOLINE_BUILD_FILE"
1212
value: "github/google-auth-library-java/.kokoro/build.sh"
1313
}
14+
15+
# By default, always run integration tests
16+
env_vars: {
17+
key: "SKIP_INTEGRATION_TESTS_IF_NO_CHANGES"
18+
value: "false"
19+
}

branches/autosynth-iamcredentials/.kokoro/presubmit/common.cfg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
1414
build_file: "google-cloud-java/.kokoro/trampoline.sh"
1515

1616
env_vars: {
17-
key: "TRAMPOLINE_BUILD_FILE"
18-
value: "github/google-cloud-java/.kokoro/build.sh"
17+
key: "TRAMPOLINE_BUILD_FILE"
18+
value: "github/google-cloud-java/.kokoro/build.sh"
1919
}
2020

2121
env_vars: {
22-
key: "JOB_TYPE"
23-
value: "test"
22+
key: "JOB_TYPE"
23+
value: "test"
24+
}
25+
26+
# For presubmits, only run integrations if the code has changed
27+
env_vars: {
28+
key: "SKIP_INTEGRATION_TESTS_IF_NO_CHANGES"
29+
value: "true"
2430
}
2531

2632
before_action {

0 commit comments

Comments
 (0)