diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 29d712c681ef..7b625e4ebead 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -36,15 +36,7 @@ fi if [[ -n "${BUILD_SUBDIR}" ]] then echo "Compiling and building all modules for ${BUILD_SUBDIR}" - mvn clean install \ - -DskipTests \ - -Dclirr.skip \ - -Dflatten.skip \ - -Dcheckstyle.skip \ - -Djacoco.skip \ - -Denforcer.skip \ - --also-make \ - --projects "${BUILD_SUBDIR}" + install_modules "${BUILD_SUBDIR}" echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" fi @@ -85,6 +77,28 @@ case ${JOB_TYPE} in echo "No Integration Tests to run" fi ;; + integration-single) + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + echo "INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS}" + mvn verify -Penable-integration-tests \ + ${INTEGRATION_TEST_ARGS} \ + -B -ntp -fae \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ + -Dcheckstyle.skip=true \ + -Dflatten.skip=true \ + -Danimal.sniffer.skip=true \ + -Djacoco.skip=true \ + -DskipUnitTests=true \ + -Dmaven.wagon.http.retryHandler.count=5 \ + -T 1C ${SUREFIRE_JVM_OPT} + + RETURN_CODE=$? + printf "Finished integration tests for modules:\n%s\n" "${BUILD_SUBDIR}" + ;; graalvm-presubmit) generate_graalvm_presubmit_modules_list if [[ "$(release_please_snapshot_pull_request)" == "true" ]]; then @@ -109,6 +123,23 @@ case ${JOB_TYPE} in echo "Not running GraalVM checks -- No changes in relevant modules" fi ;; + graalvm-single) + echo "INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS}" + mvn test -Pnative \ + ${INTEGRATION_TEST_ARGS} \ + -B -ntp -fae \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ + -Dcheckstyle.skip=true \ + -Dflatten.skip=true \ + -Danimal.sniffer.skip=true + + RETURN_CODE=$? + printf "Finished GraalVM ITs for modules:\n%s\n" "${BUILD_SUBDIR}" + ;; lint) if [ -n "${BASE_SHA}" ] && [ -n "${HEAD_SHA}" ]; then changed_file_list=$(git diff --name-only "${BASE_SHA}" "${HEAD_SHA}") diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 4f8959c245ef..c33a23c5bbe4 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -13,7 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -excluded_modules=('gapic-libraries-bom' 'google-cloud-jar-parent' 'google-cloud-pom-parent' 'java-vertexai') +excluded_modules=( + 'gapic-libraries-bom' + 'google-cloud-jar-parent' + 'google-cloud-pom-parent' + 'java-vertexai', + 'java-logging' +) function retry_with_backoff { attempts_left=$1 @@ -56,10 +62,8 @@ function retry_with_backoff { # Given a folder containing a maven multi-module, assign the variable 'submodules' to a # comma-delimited list of /. function parse_submodules() { - pushd "$1" >/dev/null - submodules_array=() - mvn_submodules=$(mvn help:evaluate -Dexpression=project.modules) + mvn_submodules=$(mvn help:evaluate -Dexpression=project.modules -pl "$1") if mvn_submodules=$(grep '<.*>.*' <<< "$mvn_submodules"); then mvn_submodules=$(sed -e 's/<.*>\(.*\)<\/.*>/\1/g' <<< "$mvn_submodules") for submodule in $mvn_submodules; do @@ -77,8 +81,6 @@ function parse_submodules() { echo "${submodules_array[*]}" ) export submodules - - popd >/dev/null } # Given a list of folders containing maven multi-modules, assign the variable 'all_submodules' to a diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 1ea066f5bf77..5805a07b9a18 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -51,6 +51,8 @@ export MAVEN_OPTS=$(determineMavenOpts) if [[ -n "${BUILD_SUBDIR}" ]] then + echo "Compiling and building all modules for ${BUILD_SUBDIR}" + install_dependencies "${BUILD_SUBDIR}" echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" fi diff --git a/.kokoro/presubmit/logging-graalvm-native-presubmit.cfg b/.kokoro/presubmit/logging-graalvm-native-presubmit.cfg new file mode 100644 index 000000000000..d16598bb817f --- /dev/null +++ b/.kokoro/presubmit/logging-graalvm-native-presubmit.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.1" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm-single" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "cloud-java-ci-test" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "cloud-java-ci-test" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/cloud-java-ci-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "cloud-java-ci-it-service-account, java-bigqueryconnection-samples-secrets" +} + +env_vars: { + key: "BUILD_SUBDIR" + value: "java-logging" +} diff --git a/.kokoro/presubmit/logging-integration.cfg b/.kokoro/presubmit/logging-integration.cfg new file mode 100644 index 000000000000..30143885f2b4 --- /dev/null +++ b/.kokoro/presubmit/logging-integration.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration-single" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "cloud-java-ci-test" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "cloud-java-ci-test" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/cloud-java-ci-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "cloud-java-ci-it-service-account, java-bigqueryconnection-samples-secrets" +} + +env_vars: { + key: "BUILD_SUBDIR" + value: "java-logging" +}