File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,28 @@ graalvm)
8080 # Run Unit and Integration Tests with Native Image
8181 bash .kokoro/populate-secrets.sh
8282 export GOOGLE_APPLICATION_CREDENTIALS=" ${KOKORO_GFILE_DIR} /secret_manager/java-it-service-account"
83- mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Pnative-test -Pslf4j2x test -pl ' oauth2_http'
83+
84+ # GraalVM Native Image ignores JAVA_TOOL_OPTIONS at runtime. If the CI environment
85+ # injects a custom truststore (e.g., for a proxy) via JAVA_TOOL_OPTIONS, we need to
86+ # extract it and pass it explicitly to the native executable.
87+ TRUST_STORE=" "
88+ if [[ " ${JAVA_TOOL_OPTIONS} " =~ -Djavax.net.ssl.trustStore= ([^ ]+) ]]; then
89+ TRUST_STORE=" ${BASH_REMATCH[1]} "
90+ fi
91+
92+ # We use 'package' instead of 'test' to build the native image without automatically
93+ # running it via the Maven plugin. This allows us to run it manually with the
94+ # extracted truststore argument in the next step, avoiding complex Maven XML overrides.
95+ mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Pnative-test -Pslf4j2x package -pl ' oauth2_http'
96+
97+ # Run the native tests manually with the truststore
98+ CMD=" ./oauth2_http/target/native-tests --xml-output-dir ./oauth2_http/target/native-test-reports"
99+ if [ -n " $TRUST_STORE " ]; then
100+ CMD=" $CMD -Djavax.net.ssl.trustStore=$TRUST_STORE "
101+ fi
102+
103+ echo " Executing: $CMD "
104+ $CMD
84105 RETURN_CODE=$?
85106 ;;
86107samples)
You can’t perform that action at this time.
0 commit comments