Skip to content

ci: restore SUREFIRE_JVM_OPT in .kokoro/build.sh - #15434

Open
lqiu96 wants to merge 1 commit into
mainfrom
ci/restore-surefire-jvm-opt
Open

lqiu96 wants to merge 1 commit into
mainfrom
ci/restore-surefire-jvm-opt

Conversation

@lqiu96

@lqiu96 lqiu96 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Restores ${SUREFIRE_JVM_OPT:-} in .kokoro/build.sh test) (dropped in #14029) and removes literal single quotes in SUREFIRE_JVM_OPT in .github/workflows/google-auth-library-java-ci.yaml (-P !slf4j2x,slf4j2x-test) so Maven matches the slf4j2x and slf4j2x-test profiles.

This restores JDK 8 runtime execution on the standalone units-java8 jobs and SLF4J 2.x logging tests in google-auth-library-java.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .kokoro/build.sh script to allow overriding the MAVEN_GOAL variable and introduces a new SUREFIRE_JVM_OPT environment variable to pass custom JVM options to Maven. The review feedback suggests using the ${SUREFIRE_JVM_OPT:-} expansion syntax to avoid potential unbound variable errors when the script is executed with set -u.

Comment thread .kokoro/build.sh Outdated
install_modules "sdk-platform-java"
fi
echo "MAVEN_GOAL: ${MAVEN_GOAL}"
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ${SUREFIRE_JVM_OPT} directly can trigger an unbound variable error if the script is run with set -u (nounset) and the variable is not defined. Using ${SUREFIRE_JVM_OPT:-} is safer and more robust.

Suggested change
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT:-}"

Comment thread .kokoro/build.sh Outdated
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
-Dmaven.wagon.http.retryHandler.count=5 \
"${EXCLUDE_PROJECTS_OPTS[@]}" \
${SUREFIRE_JVM_OPT} \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To prevent potential unbound variable errors under set -u when SUREFIRE_JVM_OPT is not defined, use the ${SUREFIRE_JVM_OPT:-} expansion syntax.

Suggested change
${SUREFIRE_JVM_OPT} \
${SUREFIRE_JVM_OPT:-} \

@lqiu96
lqiu96 force-pushed the ci/restore-surefire-jvm-opt branch from e7fa1d2 to aef62dc Compare December 4, 2026 06:29
@lqiu96 lqiu96 changed the title ci: restore SUREFIRE_JVM_OPT in build.sh and fix Spanner emulator verify goal ci: restore SUREFIRE_JVM_OPT in .kokoro/build.sh Dec 4, 2026
@lqiu96
lqiu96 marked this pull request as ready for review December 4, 2026 06:46
@lqiu96
lqiu96 requested a review from a team as a code owner December 4, 2026 06:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant