File tree Expand file tree Collapse file tree
branches/autosynth-dlp/.kokoro Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ refs/tags/v0.60.0: 4cd518d0612329f8a8e53484eef4cd1651e32855
104104refs/tags/v0.61.0: e4b526656bb1bf5eefd0ee578b7405147821225e
105105refs/tags/v0.62.0: bbede7385d48ba08f487bdd29ec10668ace96396
106106refs/heads/0.60.0-alpha: 10939381ffe0b8da32db4fe3087c86e3aa7f3e55
107- refs/heads/autosynth-dlp: d889bb0d5635749c0bc818c3caf72a953d32410f
107+ refs/heads/autosynth-dlp: f27d35d5f51ccaf06f12084dbc75f332626ffe56
108108refs/heads/autosynth-logging: f8794c50a64f62b167cddf42513d133547679e01
109109refs/heads/dupes: 3478c5d81fd242d0e985656645a679420a2060c2
110110refs/tags/v0.63.0: 94f19b71d40f46b36120e7b9d78a1a3d41bfcbd6
Original file line number Diff line number Diff line change @@ -17,14 +17,44 @@ set -eo pipefail
1717
1818cd 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
2141java -version
2242echo $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+
2454mvn 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} )
2959fi
3060
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change @@ -14,13 +14,19 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
1414build_file: " google-cloud-java/.kokoro/trampoline.sh"
1515
1616env_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
2121env_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
2632before_action {
You can’t perform that action at this time.
0 commit comments