Skip to content

Commit

Permalink
chore: Test script
Browse files Browse the repository at this point in the history
  • Loading branch information
lqiu96 committed Sep 10, 2024
1 parent 35a57bc commit 8c65c40
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
48 changes: 18 additions & 30 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function install_new_shared_deps() {

# Only reinstall shared-deps again to test for a newer proto version
if [[ "${CURRENT_PROTO_VERSION}" != "${LATEST_PROTO_VERSION}" ]]; then
# # testing-infra-docker has Java 11 installed in java8 docker container. Use this as sdk-platform-java
# # needs Java 11+ to run with GraalVM. For GH actions, JAVA11_HOME does not exist and would skip this.
# if [ ! -z "${JAVA11_HOME}" ]; then
# export JAVA_HOME="${JAVA11_HOME}"
# export PATH=${JAVA_HOME}/bin:$PATH
# fi
# testing-infra-docker has Java 11 installed in java8 docker container. Use this as sdk-platform-java
# needs Java 11+ to run with GraalVM. For GH actions, JAVA11_HOME does not exist and would skip this.
if [ ! -z "${JAVA11_HOME}" ]; then
export JAVA_HOME="${JAVA11_HOME}"
export PATH=${JAVA_HOME}/bin:$PATH
fi

pushd /tmp
git clone https://github.com/googleapis/sdk-platform-java.git
Expand Down Expand Up @@ -86,33 +86,21 @@ function install_new_shared_deps() {
fi
done

# # Reset back to the original Java version if changed
# export JAVA_HOME="${current_java_home}"
# export PATH=${JAVA_HOME}/bin:$PATH

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C
# Reset back to the original Java version if changed
export JAVA_HOME="${current_java_home}"
export PATH=${JAVA_HOME}/bin:$PATH
fi
}

function install_shared_deps() {
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C
}
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/clirr.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
value: "gcr.io/cloud-devrel-kokoro-resources/java17"
}

env_vars: {
Expand Down

0 comments on commit 8c65c40

Please sign in to comment.