From d1150a2e1ef32771d0f537586789eb8582ef5a52 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 7 Jul 2026 18:02:08 +0000 Subject: [PATCH 01/23] chore: skip unit tests for pure GAPIC modules by default Skip unit tests for all pure GAPIC generated modules to speed up CI. Handwritten libraries, including combo and manual libraries, are configured to override this behavior so that their handwritten unit tests still run. Pure GAPIC submodules of combo libraries are configured to still skip unit tests. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- google-cloud-jar-parent/pom.xml | 2 +- java-bigquery-jdbc/pom.xml | 4 +++- java-bigquery/pom.xml | 4 +++- java-bigquerystorage/pom.xml | 4 +++- java-bigtable/pom.xml | 4 +++- java-common-protos/pom.xml | 4 +++- java-datastore/pom.xml | 4 +++- java-dns/pom.xml | 4 +++- java-firestore/google-cloud-firestore-admin/pom.xml | 3 +++ java-firestore/pom.xml | 4 +++- java-iam/pom.xml | 4 +++- java-logging-logback/pom.xml | 4 +++- java-logging/pom.xml | 4 +++- java-notification/pom.xml | 4 +++- java-pubsub/pom.xml | 4 +++- java-showcase/pom.xml | 4 +++- java-spanner-jdbc/pom.xml | 4 +++- java-spanner/pom.xml | 4 +++- java-storage-nio/pom.xml | 4 +++- java-storage/gapic-google-cloud-storage-v2/pom.xml | 3 +++ java-storage/pom.xml | 4 +++- 21 files changed, 61 insertions(+), 19 deletions(-) diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index e0c993412b08..7ad02056b06a 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -19,7 +19,7 @@ ../google-cloud-pom-parent/pom.xml - false + true true diff --git a/java-bigquery-jdbc/pom.xml b/java-bigquery-jdbc/pom.xml index 681b5b84300f..6e9500aa9f5b 100644 --- a/java-bigquery-jdbc/pom.xml +++ b/java-bigquery-jdbc/pom.xml @@ -32,7 +32,9 @@ github google-cloud-bigquery-jdbc false - + + false + diff --git a/java-bigquery/pom.xml b/java-bigquery/pom.xml index 1e7084674d08..32c393dceb80 100644 --- a/java-bigquery/pom.xml +++ b/java-bigquery/pom.xml @@ -56,7 +56,9 @@ github google-cloud-bigquery-parent v2-rev20251012-2.0.0 - + + false + diff --git a/java-bigquerystorage/pom.xml b/java-bigquerystorage/pom.xml index c936c1306031..793df2d0b006 100644 --- a/java-bigquerystorage/pom.xml +++ b/java-bigquerystorage/pom.xml @@ -56,7 +56,9 @@ 3.25.4 github google-cloud-bigquerystorage-parent - + + false + diff --git a/java-bigtable/pom.xml b/java-bigtable/pom.xml index 6b6993a0b150..f1ac60f9eb25 100644 --- a/java-bigtable/pom.xml +++ b/java-bigtable/pom.xml @@ -146,7 +146,9 @@ https://googleapis.dev/java/google-api-grpc/latest 2.48.0 -g - + + false + diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index 28cc997f8ba4..6eb21244e425 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -43,7 +43,9 @@ UTF-8 github google-iam-parent - + + false + diff --git a/java-datastore/pom.xml b/java-datastore/pom.xml index 19cc247180fc..f4fcc3674705 100644 --- a/java-datastore/pom.xml +++ b/java-datastore/pom.xml @@ -146,7 +146,9 @@ https://googleapis.dev/java/google-api-grpc/latest 2.48.0 -g - + + false + diff --git a/java-dns/pom.xml b/java-dns/pom.xml index 76d3f90f13cd..1d242d5113e4 100644 --- a/java-dns/pom.xml +++ b/java-dns/pom.xml @@ -22,7 +22,9 @@ UTF-8 github google-cloud-dns-parent - + + false + diff --git a/java-firestore/google-cloud-firestore-admin/pom.xml b/java-firestore/google-cloud-firestore-admin/pom.xml index b10f49661070..81a9c0a3f024 100644 --- a/java-firestore/google-cloud-firestore-admin/pom.xml +++ b/java-firestore/google-cloud-firestore-admin/pom.xml @@ -15,6 +15,9 @@ google-cloud-firestore-parent 3.44.0-SNAPSHOT + + true + com.google.api.grpc diff --git a/java-firestore/pom.xml b/java-firestore/pom.xml index 88331720420c..decd7c8a1410 100644 --- a/java-firestore/pom.xml +++ b/java-firestore/pom.xml @@ -144,7 +144,9 @@ github google-cloud-firestore-parent https://googleapis.dev/java/google-api-grpc/latest - + + false + diff --git a/java-iam/pom.xml b/java-iam/pom.xml index cfde4e93d8b2..6bb9d7ae6e13 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -43,7 +43,9 @@ UTF-8 github google-iam-parent - + + false + diff --git a/java-logging-logback/pom.xml b/java-logging-logback/pom.xml index eee3a06b17d5..a1b7013ea032 100644 --- a/java-logging-logback/pom.xml +++ b/java-logging-logback/pom.xml @@ -20,7 +20,9 @@ 3.25.0 1.7.36 1.10.1 - + + false + com.google.cloud diff --git a/java-logging/pom.xml b/java-logging/pom.xml index 5a910924e8f0..ac38142c07e9 100644 --- a/java-logging/pom.xml +++ b/java-logging/pom.xml @@ -55,7 +55,9 @@ UTF-8 github google-cloud-logging-parent - + + false + diff --git a/java-notification/pom.xml b/java-notification/pom.xml index 3bb2bc8ad29c..45cb7e5e3c67 100644 --- a/java-notification/pom.xml +++ b/java-notification/pom.xml @@ -20,7 +20,9 @@ google-cloud-notification - + + false + diff --git a/java-pubsub/pom.xml b/java-pubsub/pom.xml index ddd7a32cae09..2f54e60fb21c 100644 --- a/java-pubsub/pom.xml +++ b/java-pubsub/pom.xml @@ -55,7 +55,9 @@ UTF-8 github google-cloud-pubsub-parent - + + false + diff --git a/java-showcase/pom.xml b/java-showcase/pom.xml index 73ba577a62d1..cef85bcdaf60 100644 --- a/java-showcase/pom.xml +++ b/java-showcase/pom.xml @@ -27,7 +27,9 @@ true true true - + + false + diff --git a/java-spanner-jdbc/pom.xml b/java-spanner-jdbc/pom.xml index a1a677dabc09..27d2779ce7ba 100644 --- a/java-spanner-jdbc/pom.xml +++ b/java-spanner-jdbc/pom.xml @@ -55,7 +55,9 @@ 1.4.5 4.11.0 0.31.1 - + + false + diff --git a/java-spanner/pom.xml b/java-spanner/pom.xml index e8fd478c69b6..9f6cc639c18e 100644 --- a/java-spanner/pom.xml +++ b/java-spanner/pom.xml @@ -55,7 +55,9 @@ UTF-8 github google-cloud-spanner-parent - + + false + diff --git a/java-storage-nio/pom.xml b/java-storage-nio/pom.xml index 23dfaf414f13..a3a92ec8c44b 100644 --- a/java-storage-nio/pom.xml +++ b/java-storage-nio/pom.xml @@ -64,7 +64,9 @@ UTF-8 github google-cloud-storage-nio-parent - + + false + diff --git a/java-storage/gapic-google-cloud-storage-v2/pom.xml b/java-storage/gapic-google-cloud-storage-v2/pom.xml index ed46a328dcbb..97818abdc9ac 100644 --- a/java-storage/gapic-google-cloud-storage-v2/pom.xml +++ b/java-storage/gapic-google-cloud-storage-v2/pom.xml @@ -12,6 +12,9 @@ google-cloud-storage-parent 2.70.0-SNAPSHOT + + true + io.grpc diff --git a/java-storage/pom.xml b/java-storage/pom.xml index a8d8a9c80871..0094dbb6bbcd 100644 --- a/java-storage/pom.xml +++ b/java-storage/pom.xml @@ -56,7 +56,9 @@ github google-cloud-storage-parent 3.31.0 - + + false + From b7eaa81d74dfdeae744c6c614f2fbd818cbd98ec Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 7 Jul 2026 18:03:55 +0000 Subject: [PATCH 02/23] chore: format properties blocks in modified POMs TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- java-bigquery-jdbc/pom.xml | 5 ++--- java-bigquery/pom.xml | 5 ++--- java-bigquerystorage/pom.xml | 5 ++--- java-bigtable/pom.xml | 19 +++++++++---------- java-common-protos/pom.xml | 5 ++--- java-datastore/pom.xml | 5 ++--- java-dns/pom.xml | 5 ++--- java-firestore/pom.xml | 5 ++--- java-iam/pom.xml | 5 ++--- java-logging-logback/pom.xml | 5 ++--- java-logging/pom.xml | 5 ++--- java-notification/pom.xml | 5 ++--- java-pubsub/pom.xml | 5 ++--- java-showcase/pom.xml | 5 ++--- java-spanner-jdbc/pom.xml | 5 ++--- java-spanner/pom.xml | 5 ++--- java-storage-nio/pom.xml | 5 ++--- java-storage/pom.xml | 5 ++--- 18 files changed, 43 insertions(+), 61 deletions(-) diff --git a/java-bigquery-jdbc/pom.xml b/java-bigquery-jdbc/pom.xml index 6e9500aa9f5b..56d3629d9ece 100644 --- a/java-bigquery-jdbc/pom.xml +++ b/java-bigquery-jdbc/pom.xml @@ -32,9 +32,8 @@ github google-cloud-bigquery-jdbc false - - false - + false + diff --git a/java-bigquery/pom.xml b/java-bigquery/pom.xml index 32c393dceb80..e2b6168630dd 100644 --- a/java-bigquery/pom.xml +++ b/java-bigquery/pom.xml @@ -56,9 +56,8 @@ github google-cloud-bigquery-parent v2-rev20251012-2.0.0 - - false - + false + diff --git a/java-bigquerystorage/pom.xml b/java-bigquerystorage/pom.xml index 793df2d0b006..fe3ae7e94a4d 100644 --- a/java-bigquerystorage/pom.xml +++ b/java-bigquerystorage/pom.xml @@ -56,9 +56,8 @@ 3.25.4 github google-cloud-bigquerystorage-parent - - false - + false + diff --git a/java-bigtable/pom.xml b/java-bigtable/pom.xml index f1ac60f9eb25..f03f7d2f3cb6 100644 --- a/java-bigtable/pom.xml +++ b/java-bigtable/pom.xml @@ -139,16 +139,15 @@ - UTF-8 - UTF-8 - github - google-cloud-bigtable-parent - https://googleapis.dev/java/google-api-grpc/latest - 2.48.0 - -g - - false - + UTF-8 + UTF-8 + github + google-cloud-bigtable-parent + https://googleapis.dev/java/google-api-grpc/latest + 2.48.0 + -g + false + diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index 6eb21244e425..3b1d049c3f53 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -43,9 +43,8 @@ UTF-8 github google-iam-parent - - false - + false + diff --git a/java-datastore/pom.xml b/java-datastore/pom.xml index f4fcc3674705..dfd614b18eed 100644 --- a/java-datastore/pom.xml +++ b/java-datastore/pom.xml @@ -146,9 +146,8 @@ https://googleapis.dev/java/google-api-grpc/latest 2.48.0 -g - - false - + false + diff --git a/java-dns/pom.xml b/java-dns/pom.xml index 1d242d5113e4..8800d304990a 100644 --- a/java-dns/pom.xml +++ b/java-dns/pom.xml @@ -22,9 +22,8 @@ UTF-8 github google-cloud-dns-parent - - false - + false + diff --git a/java-firestore/pom.xml b/java-firestore/pom.xml index decd7c8a1410..77e404dc3699 100644 --- a/java-firestore/pom.xml +++ b/java-firestore/pom.xml @@ -144,9 +144,8 @@ github google-cloud-firestore-parent https://googleapis.dev/java/google-api-grpc/latest - - false - + false + diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 6bb9d7ae6e13..978aaec95f82 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -43,9 +43,8 @@ UTF-8 github google-iam-parent - - false - + false + diff --git a/java-logging-logback/pom.xml b/java-logging-logback/pom.xml index a1b7013ea032..56d9ab0442e9 100644 --- a/java-logging-logback/pom.xml +++ b/java-logging-logback/pom.xml @@ -20,9 +20,8 @@ 3.25.0 1.7.36 1.10.1 - - false - + false + com.google.cloud diff --git a/java-logging/pom.xml b/java-logging/pom.xml index ac38142c07e9..2c8dd6348297 100644 --- a/java-logging/pom.xml +++ b/java-logging/pom.xml @@ -55,9 +55,8 @@ UTF-8 github google-cloud-logging-parent - - false - + false + diff --git a/java-notification/pom.xml b/java-notification/pom.xml index 45cb7e5e3c67..5bc628e776f7 100644 --- a/java-notification/pom.xml +++ b/java-notification/pom.xml @@ -20,9 +20,8 @@ google-cloud-notification - - false - + false + diff --git a/java-pubsub/pom.xml b/java-pubsub/pom.xml index 2f54e60fb21c..16f6166c17a1 100644 --- a/java-pubsub/pom.xml +++ b/java-pubsub/pom.xml @@ -55,9 +55,8 @@ UTF-8 github google-cloud-pubsub-parent - - false - + false + diff --git a/java-showcase/pom.xml b/java-showcase/pom.xml index cef85bcdaf60..334789505116 100644 --- a/java-showcase/pom.xml +++ b/java-showcase/pom.xml @@ -27,9 +27,8 @@ true true true - - false - + false + diff --git a/java-spanner-jdbc/pom.xml b/java-spanner-jdbc/pom.xml index 27d2779ce7ba..1da1b106fb80 100644 --- a/java-spanner-jdbc/pom.xml +++ b/java-spanner-jdbc/pom.xml @@ -55,9 +55,8 @@ 1.4.5 4.11.0 0.31.1 - - false - + false + diff --git a/java-spanner/pom.xml b/java-spanner/pom.xml index 9f6cc639c18e..5fd0138cbcff 100644 --- a/java-spanner/pom.xml +++ b/java-spanner/pom.xml @@ -55,9 +55,8 @@ UTF-8 github google-cloud-spanner-parent - - false - + false + diff --git a/java-storage-nio/pom.xml b/java-storage-nio/pom.xml index a3a92ec8c44b..0a53f8e54ef4 100644 --- a/java-storage-nio/pom.xml +++ b/java-storage-nio/pom.xml @@ -64,9 +64,8 @@ UTF-8 github google-cloud-storage-nio-parent - - false - + false + diff --git a/java-storage/pom.xml b/java-storage/pom.xml index 0094dbb6bbcd..ec1773903946 100644 --- a/java-storage/pom.xml +++ b/java-storage/pom.xml @@ -56,9 +56,8 @@ github google-cloud-storage-parent 3.31.0 - - false - + false + From 175e764d141e55e00e35ea3105306ead4f2a6958 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 7 Jul 2026 18:44:48 +0000 Subject: [PATCH 03/23] chore: fix indentation for java-bigtable properties block TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- java-bigtable/pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java-bigtable/pom.xml b/java-bigtable/pom.xml index f03f7d2f3cb6..fdcd4466895a 100644 --- a/java-bigtable/pom.xml +++ b/java-bigtable/pom.xml @@ -139,14 +139,14 @@ - UTF-8 - UTF-8 - github - google-cloud-bigtable-parent - https://googleapis.dev/java/google-api-grpc/latest - 2.48.0 - -g - false + UTF-8 + UTF-8 + github + google-cloud-bigtable-parent + https://googleapis.dev/java/google-api-grpc/latest + 2.48.0 + -g + false From 89f6801a3ec66054d86608863b7a7398e7ea569f Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 7 Jul 2026 21:20:11 -0400 Subject: [PATCH 04/23] chore: Trigger all unit tests to run --- google-cloud-jar-parent/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index 7ad02056b06a..97676908a0ff 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -12,6 +12,7 @@ The parent for all client library JAR modules in the repository. + com.google.cloud google-cloud-pom-parent From e7809ecd2ad5f7216a2e05ac87d99b08d850907d Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 02:05:23 +0000 Subject: [PATCH 05/23] chore: optimize kokoro test job to use mvn test Instead of using mvn install to execute unit tests, use mvn test to avoid the packaging phase and skip building JAR files, speeding up the test lifecycle. Handwritten libraries share the same execution path under JOB_TYPE=test, and since install_modules compiles and installs their external dependencies to .m2 beforehand, running mvn test is sufficient and correct for both handwritten and generated libraries. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 92e714cb451e..7275ff0b59e6 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -50,7 +50,7 @@ case ${JOB_TYPE} in fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ - mvn install \ + mvn test \ -B -ntp \ -Pquick-build \ -Dorg.slf4j.simpleLogger.showDateTime=true \ From fe04b820929e9790e2520e111a1526fcf568c653 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 02:31:25 +0000 Subject: [PATCH 06/23] chore: upgrade flatten-maven-plugin to 1.6.0 and use mvn package for testing Upgraded the flatten-maven-plugin to 1.6.0. This allows the skip feature (via flatten.skip property) to work during quick-build executions, providing a compile speedup. Restored the test execution command in build.sh to use mvn package instead of mvn test. This is necessary because some downstream modules (such as java-accessapproval) have dependencies on test-jar artifacts (specifically gax-grpc testlib) from other modules in the same reactor. If we only run up to the 'test' phase, these test-jars are never packaged, causing downstream test compilation to fail with "cannot find symbol" errors for test utility classes (e.g. MockServiceHelper, MockGrpcService). Using mvn package ensures the test-jars are packaged during the build while still skipping integration tests (via skipITs). TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 2 +- java-shared-config/java-shared-config/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 7275ff0b59e6..56b2bc9bf7cf 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -50,7 +50,7 @@ case ${JOB_TYPE} in fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ - mvn test \ + mvn package \ -B -ntp \ -Pquick-build \ -Dorg.slf4j.simpleLogger.showDateTime=true \ diff --git a/java-shared-config/java-shared-config/pom.xml b/java-shared-config/java-shared-config/pom.xml index b22fe21174e2..c97fb2c475f0 100644 --- a/java-shared-config/java-shared-config/pom.xml +++ b/java-shared-config/java-shared-config/pom.xml @@ -183,7 +183,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.3.0 + 1.6.0 From bddf72396f562dfec25a260e9b211d27c08b7394 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 03:02:24 +0000 Subject: [PATCH 07/23] chore: optimize global unit test execution in CI Optimized the unit test target in build.sh when running on the entire repository (global run): 1. Dynamically resolve all Maven modules that should run unit tests (modules under java-* that have skipUnitTests=false in their parents, excluding any submodules that explicitly override it to true). 2. Changed the test command from 'mvn package' back to 'mvn test' and targeted only the resolved modules using the '-pl' flag. 3. Removed the '--also-make' flag from the global run to prevent Maven from pulling sdk-platform-java back into the reactor. This ensures that: - We do not build JAR files for any of the client library modules, saving I/O and time. - We do not compile or build the 250+ skipped pure GAPIC modules during the test run. - Core dependencies from sdk-platform-java (which are pre-installed in .m2) are resolved from the local repository cache, bypassing the reactor test-jar dependency issues. For subdirectory runs (where BUILD_SUBDIR is set), we continue using --also-make and mvn test, as the reactor is already restricted to that subdirectory and dependencies are pre-populated in .m2. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 56b2bc9bf7cf..1833219a5e6a 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -44,19 +44,54 @@ case ${JOB_TYPE} in echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" EXTRA_PROFILE_OPTS=() + MVN_ARGS=("--also-make") else EXTRA_PROFILE_OPTS=("-PbulkTests") install_modules "sdk-platform-java" + + echo "Resolving test-enabled modules..." + TEST_MODULES=$(python3 -c " +import xml.etree.ElementTree as ET +import glob, os +ns = {'m': 'http://maven.apache.org/POM/4.0.0'} +ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0') +mods = [] +for pom in glob.glob('java-*/pom.xml'): + p_dir = os.path.dirname(pom) + try: + root = ET.parse(pom).getroot() + skip = root.find('.//m:properties/m:skipUnitTests', ns) + if skip is not None and skip.text == 'false': + modules = root.find('m:modules', ns) + if modules is not None: + for m in modules.findall('m:module', ns): + child = os.path.join(p_dir, m.text) + cpom = os.path.join(child, 'pom.xml') + if os.path.exists(cpom): + croot = ET.parse(cpom).getroot() + cskip = croot.find('.//m:properties/m:skipUnitTests', ns) + if cskip is not None and cskip.text == 'true': continue + mods.append(child) + else: mods.append(p_dir) + except: pass +print(','.join(mods)) +") + echo "Modules to test: ${TEST_MODULES}" + if [[ -z "${TEST_MODULES}" ]]; then + echo "No test-enabled modules found! Exiting." + exit 0 + fi + MVN_ARGS=("-pl" "${TEST_MODULES}") fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ - mvn package \ + mvn test \ -B -ntp \ -Pquick-build \ -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ - --also-make \ + "${MVN_ARGS[@]}" \ ${SUREFIRE_JVM_OPT} "${EXTRA_PROFILE_OPTS[@]}" RETURN_CODE=$? From aa39fe726353b947c2dffc7ea692005ae5f47fc0 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 03:32:48 +0000 Subject: [PATCH 08/23] chore: use static core exclusions for global unit tests Replaced the dynamic python-based module resolution with a static list of exclusions in build.sh for the global unit test run. We run 'mvn test' (which compiles classes but skips JAR packaging) and exclude the core modules that generate test-jars (gax, gax-grpc, gax-httpjson, google-cloud-core) from the reactor. This forces Maven to resolve these test-jar dependencies from the pre-installed local .m2 cache instead of the reactor, avoiding compilation failures. This satisfies the requirement to avoid building JARs during the unit test run without introducing dynamic scripts in build.sh. Note that this will compile all remaining modules in the repository, which will increase the build time compared to targeting only test-enabled modules. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 1833219a5e6a..7ec0ed19190b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -49,39 +49,10 @@ case ${JOB_TYPE} in EXTRA_PROFILE_OPTS=("-PbulkTests") install_modules "sdk-platform-java" - echo "Resolving test-enabled modules..." - TEST_MODULES=$(python3 -c " -import xml.etree.ElementTree as ET -import glob, os -ns = {'m': 'http://maven.apache.org/POM/4.0.0'} -ET.register_namespace('', 'http://maven.apache.org/POM/4.0.0') -mods = [] -for pom in glob.glob('java-*/pom.xml'): - p_dir = os.path.dirname(pom) - try: - root = ET.parse(pom).getroot() - skip = root.find('.//m:properties/m:skipUnitTests', ns) - if skip is not None and skip.text == 'false': - modules = root.find('m:modules', ns) - if modules is not None: - for m in modules.findall('m:module', ns): - child = os.path.join(p_dir, m.text) - cpom = os.path.join(child, 'pom.xml') - if os.path.exists(cpom): - croot = ET.parse(cpom).getroot() - cskip = croot.find('.//m:properties/m:skipUnitTests', ns) - if cskip is not None and cskip.text == 'true': continue - mods.append(child) - else: mods.append(p_dir) - except: pass -print(','.join(mods)) -") - echo "Modules to test: ${TEST_MODULES}" - if [[ -z "${TEST_MODULES}" ]]; then - echo "No test-enabled modules found! Exiting." - exit 0 - fi - MVN_ARGS=("-pl" "${TEST_MODULES}") + # Exclude core modules that generate test-jars from the reactor. + # This allows running 'mvn test' (no JAR packaging) without reactor resolution errors. + # These excluded modules are resolved from the pre-installed .m2 cache instead. + MVN_ARGS=("-pl" "!sdk-platform-java/gax-java/gax,!sdk-platform-java/gax-java/gax-grpc,!sdk-platform-java/gax-java/gax-httpjson,!sdk-platform-java/java-core/google-cloud-core") fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ From 7f43a3849b64b05249991b995d17d70bd4cfa240 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 04:02:49 +0000 Subject: [PATCH 09/23] build(config): map maven.test.skip to skipUnitTests in jar-parent Map the standard Maven property `maven.test.skip` to our custom `skipUnitTests` property in `google-cloud-jar-parent/pom.xml`. This skips compiling test sources and copying test resources for all modules that have `skipUnitTests=true` (which is the default for GAPIC generated libraries). This will significantly speed up compilation during global `mvn test` runs by avoiding compilation of tests that are not going to be executed anyway. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- google-cloud-jar-parent/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index 97676908a0ff..0d466695e897 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -21,6 +21,7 @@ true + ${skipUnitTests} true From 72ae7478a2467a5ea8ba3bb9f1f7430d79b30ea1 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 04:08:16 +0000 Subject: [PATCH 10/23] docs(config): document maven.test.skip and skipUnitTests mapping Add comments in `google-cloud-jar-parent/pom.xml` explaining the relationship between `skipUnitTests` and `maven.test.skip`, and how they are used to skip both compilation and execution of tests by default, while still allowing integration tests to compile and run when needed. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- google-cloud-jar-parent/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index 0d466695e897..fdb1b9141d96 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -20,7 +20,14 @@ ../google-cloud-pom-parent/pom.xml + true + ${skipUnitTests} true From d46c880fa82f961ed4eac5e501966990b01fa2c1 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 04:36:02 +0000 Subject: [PATCH 11/23] ci(opt): skip client library tests in global run Add `-DskipUnitTests=true` to `SUREFIRE_JVM_OPT` in `.kokoro/build.sh` for global runs (where `BUILD_SUBDIR` is empty). Since `skipUnitTests` is mapped to `maven.test.skip` in `google-cloud-jar-parent`, this will skip both compilation and execution of tests for all client libraries (both GAPIC and veneers) in the global unit test job. This is safe because veneers have their own individual `split-units` jobs that run their tests, so we don't need to build or run them in the global job. This should yield another significant speedup by avoiding compiling/running tests for the handwritten libraries in the global run. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 7ec0ed19190b..659aaae7ee11 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -53,6 +53,7 @@ case ${JOB_TYPE} in # This allows running 'mvn test' (no JAR packaging) without reactor resolution errors. # These excluded modules are resolved from the pre-installed .m2 cache instead. MVN_ARGS=("-pl" "!sdk-platform-java/gax-java/gax,!sdk-platform-java/gax-java/gax-grpc,!sdk-platform-java/gax-java/gax-httpjson,!sdk-platform-java/java-core/google-cloud-core") + SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true" fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ From be9437bbef7a9910834d3114d21c33e11c96ab51 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 04:54:45 +0000 Subject: [PATCH 12/23] fix(spanner-jdbc): respect maven.test.skip in doc generation exec Update `java-spanner-jdbc/pom.xml` to set `${maven.test.skip}` for the `generate_connection_properties_documentation` execution of `exec-maven-plugin`. This avoids `ClassNotFoundException` during builds where test compilation is skipped (like the global unit test run with `skipUnitTests=true` -> `maven.test.skip=true`), because the class it attempts to run (`ConnectionPropertiesFileGenerator`) is in `src/test/java` and will not be compiled. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- java-spanner-jdbc/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-spanner-jdbc/pom.xml b/java-spanner-jdbc/pom.xml index 1da1b106fb80..47a17cc3b87f 100644 --- a/java-spanner-jdbc/pom.xml +++ b/java-spanner-jdbc/pom.xml @@ -346,7 +346,7 @@ ${project.basedir}/documentation/connection_properties.md test - false + ${maven.test.skip} From 25ae681a09ab3e7f7ede23462fb955e73cd69c60 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 05:17:03 +0000 Subject: [PATCH 13/23] ci(opt): skip test compilation globally in global run Add `-Dmaven.test.skip=true` to `SUREFIRE_JVM_OPT` in `.kokoro/build.sh` for global runs. While we previously mapped `skipUnitTests` to `maven.test.skip` in `google-cloud-jar-parent` for client libraries, core modules (like `gapic-generator-java`) and `google-auth-library-java` do not inherit from it and thus were still compiling their tests during the global compilation check. In particular, `gapic-generator-java` was recompiling its 750+ tests due to dependency changes (caused by reactor exclusions), taking ~8 seconds. By passing `-Dmaven.test.skip=true` globally on the command line, we ensure all modules in the reactor skip test compilation during this job, as we only want to verify that the main classes compile successfully. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 659aaae7ee11..067f11b0f3d3 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -53,7 +53,7 @@ case ${JOB_TYPE} in # This allows running 'mvn test' (no JAR packaging) without reactor resolution errors. # These excluded modules are resolved from the pre-installed .m2 cache instead. MVN_ARGS=("-pl" "!sdk-platform-java/gax-java/gax,!sdk-platform-java/gax-java/gax-grpc,!sdk-platform-java/gax-java/gax-httpjson,!sdk-platform-java/java-core/google-cloud-core") - SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true" + SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -Dmaven.test.skip=true" fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ From 56103e135987842cb8e2b5ddc162c02ba190eb3c Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 05:43:44 +0000 Subject: [PATCH 14/23] ci(opt): simplify global test run by removing core exclusions and install Remove the pre-installation step for `sdk-platform-java` and the static reactor exclusions (`MVN_ARGS`) in `.kokoro/build.sh` for the global `test` job. Now that we pass `-Dmaven.test.skip=true` globally on the command line, Maven completely skips test compilation for all modules. As a result, it no longer attempts to resolve test-scoped dependencies (including `test-jar`s like `gax-grpc:testlib`). This allows us to: 1. Run `mvn test` on the full reactor without getting reactor resolution errors for `test-jar`s of unpackaged modules. 2. Remove the `install_modules "sdk-platform-java"` step that was previously required to pre-populate `.m2` with core jars, saving ~1 minute of build time. The entire monorepo compilation is now verified in a single maven invocation. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 067f11b0f3d3..b4d589afc6e8 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,12 +47,10 @@ case ${JOB_TYPE} in MVN_ARGS=("--also-make") else EXTRA_PROFILE_OPTS=("-PbulkTests") - install_modules "sdk-platform-java" - - # Exclude core modules that generate test-jars from the reactor. - # This allows running 'mvn test' (no JAR packaging) without reactor resolution errors. - # These excluded modules are resolved from the pre-installed .m2 cache instead. - MVN_ARGS=("-pl" "!sdk-platform-java/gax-java/gax,!sdk-platform-java/gax-java/gax-grpc,!sdk-platform-java/gax-java/gax-httpjson,!sdk-platform-java/java-core/google-cloud-core") + # We do not need to install core modules or exclude them from the reactor. + # Since we pass -Dmaven.test.skip=true, Maven skips test compilation globally, + # which avoids any test-jar reactor resolution errors during compilation verification. + MVN_ARGS=() SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -Dmaven.test.skip=true" fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" From 36ed633e9706f1309791a6b628537172b5c7429b Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 05:59:39 +0000 Subject: [PATCH 15/23] ci(opt): remove redundant --also-make from targeted test runs Remove `MVN_ARGS=("--also-make")` in `.kokoro/build.sh` for targeted runs (`BUILD_SUBDIR` case). Since the script performs a `pushd "${BUILD_SUBDIR}"` and runs `mvn test` from within that directory without specifying a project list (`-pl`), the `--also-make` (`-am`) flag has no effect and is redundant. Also document this in the plan. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index b4d589afc6e8..111d71baeb1d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -44,7 +44,7 @@ case ${JOB_TYPE} in echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" EXTRA_PROFILE_OPTS=() - MVN_ARGS=("--also-make") + MVN_ARGS=() else EXTRA_PROFILE_OPTS=("-PbulkTests") # We do not need to install core modules or exclude them from the reactor. From e6d1f47fe98305b830726b0bb0515e9a02e759ff Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 06:00:59 +0000 Subject: [PATCH 16/23] ci(opt): remove MVN_ARGS entirely and add comments for skip properties - Remove the `MVN_ARGS` variable entirely from the `test` job in `.kokoro/build.sh`, as it is now empty for both global and targeted runs. - Add a detailed comment in `.kokoro/build.sh` explaining why both `-DskipUnitTests=true` and `-Dmaven.test.skip=true` are required to correctly skip test compilation and execution across different module types (core vs client libraries). - Update the plan artifact to reflect these changes. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 111d71baeb1d..7eb62aeb2cb6 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -44,13 +44,17 @@ case ${JOB_TYPE} in echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" EXTRA_PROFILE_OPTS=() - MVN_ARGS=() else EXTRA_PROFILE_OPTS=("-PbulkTests") # We do not need to install core modules or exclude them from the reactor. # Since we pass -Dmaven.test.skip=true, Maven skips test compilation globally, # which avoids any test-jar reactor resolution errors during compilation verification. - MVN_ARGS=() + # + # We need both properties: + # - -Dmaven.test.skip=true is for core modules that do not use skipUnitTests. + # - -DskipUnitTests=true is for client libraries, because their surefire plugin configuration + # explicitly overrides surefire skip parameter to ${skipUnitTests} which defaults to false + # in handwritten libraries and would otherwise execute tests anyway. SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -Dmaven.test.skip=true" fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" @@ -61,7 +65,6 @@ case ${JOB_TYPE} in -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ - "${MVN_ARGS[@]}" \ ${SUREFIRE_JVM_OPT} "${EXTRA_PROFILE_OPTS[@]}" RETURN_CODE=$? From 1411069c1799a52b982718d361edd609d521f4c8 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 06:02:43 +0000 Subject: [PATCH 17/23] ci(opt): remove bulkTests and EXTRA_PROFILE_OPTS from unit test job - Remove the activation of the `bulkTests` profile (`-PbulkTests`) in `.kokoro/build.sh` for global runs. Since we skip all tests globally using properties, we no longer need the profile to selectively skip handwritten/core tests. - Remove the unused `EXTRA_PROFILE_OPTS` variable entirely from the `test` and `clirr` jobs in `.kokoro/build.sh`. - Update the plan to document these changes. Note: The `bulkTests` profile definitions are kept in POMs for now as they are still needed by the integration test runner (`run_integration_tests` in `common.sh`) to skip transitively included modules' unit tests. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 7eb62aeb2cb6..fefa041e1fea 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -43,9 +43,7 @@ case ${JOB_TYPE} in install_modules "${BUILD_SUBDIR}" echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" - EXTRA_PROFILE_OPTS=() else - EXTRA_PROFILE_OPTS=("-PbulkTests") # We do not need to install core modules or exclude them from the reactor. # Since we pass -Dmaven.test.skip=true, Maven skips test compilation globally, # which avoids any test-jar reactor resolution errors during compilation verification. @@ -65,7 +63,7 @@ case ${JOB_TYPE} in -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ - ${SUREFIRE_JVM_OPT} "${EXTRA_PROFILE_OPTS[@]}" + ${SUREFIRE_JVM_OPT} RETURN_CODE=$? if [[ -n "${BUILD_SUBDIR}" ]] @@ -324,7 +322,6 @@ case ${JOB_TYPE} in install_modules "${BUILD_SUBDIR}" echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" - EXTRA_PROFILE_OPTS=() else install_modules "sdk-platform-java" fi From 72dd906a91da7f2de9ad419cc6dbb4d4ec9f09ec Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 18:17:21 +0000 Subject: [PATCH 18/23] ci(opt): use skipTests instead of maven.test.skip globally in build.sh Using maven.test.skip=true globally on the CLI overrides all module configurations and skips all test compilation. This breaks compilation of gapic-generator-java because it depends on gax-grpc testlib, which is not compiled and cannot be resolved in the reactor. Switch to using -DskipTests=true globally to skip execution for all modules, and -DskipUnitTests=true to skip test compilation for client libraries (via google-cloud-jar-parent mapping). Core modules (gax, etc.) do not inherit this mapping, so their tests are compiled, resolving the reactor dependency issues. TAG=agy CONV=2e2339aa-553a-429d-a821-1c9ae142d816 --- .kokoro/build.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index fefa041e1fea..52e0a27a3154 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -45,15 +45,12 @@ case ${JOB_TYPE} in pushd "${BUILD_SUBDIR}" else # We do not need to install core modules or exclude them from the reactor. - # Since we pass -Dmaven.test.skip=true, Maven skips test compilation globally, - # which avoids any test-jar reactor resolution errors during compilation verification. - # - # We need both properties: - # - -Dmaven.test.skip=true is for core modules that do not use skipUnitTests. - # - -DskipUnitTests=true is for client libraries, because their surefire plugin configuration - # explicitly overrides surefire skip parameter to ${skipUnitTests} which defaults to false - # in handwritten libraries and would otherwise execute tests anyway. - SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -Dmaven.test.skip=true" + # We pass -DskipTests=true to skip running tests globally. + # We pass -DskipUnitTests=true which maps to -Dmaven.test.skip=true for client libraries + # (via google-cloud-jar-parent), skipping their test compilation to save time. + # Core modules do not inherit this mapping, so their tests are compiled, which is + # necessary to resolve testlib dependencies (like gax-grpc testlib) in the reactor. + SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -DskipTests=true" fi echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" retry_with_backoff 3 10 \ From 385bc34649eeaa0712fd213f438a19b8d0e240e1 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 8 Jul 2026 16:10:12 -0400 Subject: [PATCH 19/23] chore: Reset changes not needed in the PR --- google-cloud-jar-parent/pom.xml | 1 - java-shared-config/java-shared-config/pom.xml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index fdb1b9141d96..c80a62d26dbe 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -12,7 +12,6 @@ The parent for all client library JAR modules in the repository. - com.google.cloud google-cloud-pom-parent diff --git a/java-shared-config/java-shared-config/pom.xml b/java-shared-config/java-shared-config/pom.xml index c97fb2c475f0..b22fe21174e2 100644 --- a/java-shared-config/java-shared-config/pom.xml +++ b/java-shared-config/java-shared-config/pom.xml @@ -183,7 +183,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 + 1.3.0 From 4355c119deb4cb664c59ce016ef1b12d4434e117 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Thu, 9 Jul 2026 00:22:27 -0400 Subject: [PATCH 20/23] Remove redundant bulkTests profiles and clarify test-skip comments --- .kokoro/build.sh | 22 +++++++++++++--------- .kokoro/common.sh | 8 ++++++++ google-cloud-jar-parent/pom.xml | 17 ++++++++++++++++- java-bigquery-jdbc/pom.xml | 8 -------- java-bigquery/pom.xml | 7 ------- java-bigquerystorage/pom.xml | 10 ---------- java-bigtable/pom.xml | 6 ------ java-datastore/pom.xml | 7 ------- java-firestore/pom.xml | 6 ------ java-logging-logback/pom.xml | 7 ------- java-logging/pom.xml | 10 ---------- java-pubsub/pom.xml | 9 --------- java-showcase/pom.xml | 7 ------- java-spanner/pom.xml | 10 ---------- java-storage/pom.xml | 6 ------ 15 files changed, 37 insertions(+), 103 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 52e0a27a3154..48838f8124f8 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -44,15 +44,19 @@ case ${JOB_TYPE} in echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" else - # We do not need to install core modules or exclude them from the reactor. - # We pass -DskipTests=true to skip running tests globally. - # We pass -DskipUnitTests=true which maps to -Dmaven.test.skip=true for client libraries - # (via google-cloud-jar-parent), skipping their test compilation to save time. - # Core modules do not inherit this mapping, so their tests are compiled, which is - # necessary to resolve testlib dependencies (like gax-grpc testlib) in the reactor. - SUREFIRE_JVM_OPT="${SUREFIRE_JVM_OPT} -DskipUnitTests=true -DskipTests=true" + # -DskipUnitTests=true is where the real time savings come from: it skips both + # compiling and running tests for most client-library modules. A few "core" modules + # (google-auth-library-java, grpc-gcp-java, sdk-platform-java) don't honor it though, + # so we also pass plain -DskipTests=true to stop their tests from running. We + # deliberately leave their test *compilation* alone, since other modules in the + # reactor need testlib artifacts (like gax-grpc's) that only that compile step + # produces. We looked at pre-building those core modules separately so this second + # flag wouldn't be needed, but they turned out to have a real circular dependency on + # generated client code, so a single combined pass like this is the simplest thing + # that actually works. + EXTRA_MAVEN_OPTS="${EXTRA_MAVEN_OPTS} -DskipUnitTests=true -DskipTests=true" fi - echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + echo "EXTRA_MAVEN_OPTS: ${EXTRA_MAVEN_OPTS}" retry_with_backoff 3 10 \ mvn test \ -B -ntp \ @@ -60,7 +64,7 @@ case ${JOB_TYPE} in -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ -Dmaven.wagon.http.retryHandler.count=5 \ - ${SUREFIRE_JVM_OPT} + ${EXTRA_MAVEN_OPTS} RETURN_CODE=$? if [[ -n "${BUILD_SUBDIR}" ]] diff --git a/.kokoro/common.sh b/.kokoro/common.sh index a1dad45d963d..f46079609810 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -311,6 +311,14 @@ function run_integration_tests() { parse_all_submodules "$1" printf "Running integration tests for submodules:\n%s\n" "$all_submodules" + # This job needs integration tests to actually run, so plain -DskipTests=true is off the + # table here (it would skip those too). We only want unit tests skipped, hence two + # narrower flags instead: -DskipUnitTests=true for client-library modules (see + # google-cloud-jar-parent/pom.xml for how that's wired), and -PbulkTests for the handful + # of modules (google-auth-library-java, java-cloud-bom, java-shared-config, + # sdk-platform-java) that predate and sit outside that mechanism. We just pass both + # always rather than figure out per-module which one applies; Maven ignores whichever one + # a given module doesn't recognize. mvn verify -Penable-integration-tests -Pquick-build --projects "$all_submodules" \ ${INTEGRATION_TEST_ARGS} \ -B -ntp -fae \ diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index d99c5252310f..b5402a7b30b8 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -19,7 +19,22 @@ ../google-cloud-pom-parent/pom.xml - + true - - bulkTests - - true - - - docker diff --git a/java-bigquery/pom.xml b/java-bigquery/pom.xml index c037c814b757..9de42ad51ef9 100644 --- a/java-bigquery/pom.xml +++ b/java-bigquery/pom.xml @@ -163,12 +163,5 @@ benchmark - - - bulkTests - - true - - diff --git a/java-bigquerystorage/pom.xml b/java-bigquerystorage/pom.xml index 85819c5275c8..88655956bb3b 100644 --- a/java-bigquerystorage/pom.xml +++ b/java-bigquerystorage/pom.xml @@ -208,14 +208,4 @@ google-cloud-bigquerystorage-bom - - - - bulkTests - - true - - - - diff --git a/java-bigtable/pom.xml b/java-bigtable/pom.xml index 384e34374b22..578bd470c60c 100644 --- a/java-bigtable/pom.xml +++ b/java-bigtable/pom.xml @@ -343,12 +343,6 @@ - - bulkTests - - true - - errorprone-jdk8 diff --git a/java-datastore/pom.xml b/java-datastore/pom.xml index 0edcb6095a60..6b2a30139b96 100644 --- a/java-datastore/pom.xml +++ b/java-datastore/pom.xml @@ -237,13 +237,6 @@ - - - bulkTests - - true - - errorprone-jdk8 diff --git a/java-firestore/pom.xml b/java-firestore/pom.xml index 5128f011c8f7..56e7affe0a27 100644 --- a/java-firestore/pom.xml +++ b/java-firestore/pom.xml @@ -248,11 +248,5 @@ - - bulkTests - - true - - diff --git a/java-logging-logback/pom.xml b/java-logging-logback/pom.xml index d4f45f43f293..1a9c9e057d26 100644 --- a/java-logging-logback/pom.xml +++ b/java-logging-logback/pom.xml @@ -171,12 +171,5 @@ !LoggingAppenderTest - - - bulkTests - - true - - diff --git a/java-logging/pom.xml b/java-logging/pom.xml index 21c01a8c590a..507c8f25e42d 100644 --- a/java-logging/pom.xml +++ b/java-logging/pom.xml @@ -106,14 +106,4 @@ google-cloud-logging-bom - - - - - bulkTests - - true - - - diff --git a/java-pubsub/pom.xml b/java-pubsub/pom.xml index fbc446cc86da..87e13482d504 100644 --- a/java-pubsub/pom.xml +++ b/java-pubsub/pom.xml @@ -144,13 +144,4 @@ google-cloud-pubsub-bom - - - - bulkTests - - true - - - diff --git a/java-showcase/pom.xml b/java-showcase/pom.xml index 9c79f09b002e..5cd52fb97aee 100644 --- a/java-showcase/pom.xml +++ b/java-showcase/pom.xml @@ -260,12 +260,5 @@ - - - bulkTests - - true - - diff --git a/java-spanner/pom.xml b/java-spanner/pom.xml index ff794cb8894a..3060f3b002b6 100644 --- a/java-spanner/pom.xml +++ b/java-spanner/pom.xml @@ -159,14 +159,4 @@ - - - - bulkTests - - true - - - - diff --git a/java-storage/pom.xml b/java-storage/pom.xml index c45aebaa069c..074c0156b80f 100644 --- a/java-storage/pom.xml +++ b/java-storage/pom.xml @@ -188,12 +188,6 @@ storage-shared-benchmarking - - bulkTests - - true - - true ${skipUnitTests} true @@ -194,6 +206,12 @@ + + enable-integration-tests + + false + + java17 diff --git a/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml b/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml index 76fff743425f..59ff0ddce588 100644 --- a/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml +++ b/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml @@ -20,6 +20,24 @@ + false java.header 8 @@ -46,6 +64,18 @@ true + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipUnitTests} + + + + + suztomo @@ -223,13 +253,24 @@ - + bulkTests true + + enable-integration-tests + + false + + From 15184d95ef3062f6bc95822e9b946e52899ee847 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Thu, 9 Jul 2026 02:12:39 -0400 Subject: [PATCH 23/23] Run GAPIC unit-test CI as compile-only and trim now-unneeded test-skip config --- .kokoro/build.sh | 19 ++++------ .kokoro/common.sh | 1 + google-cloud-jar-parent/pom.xml | 38 +++++-------------- .../gapic-generator-java-pom-parent/pom.xml | 27 +++---------- 4 files changed, 24 insertions(+), 61 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index ef9f81b297b2..d5bc2efff86e 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -37,6 +37,7 @@ RETURN_CODE=0 case ${JOB_TYPE} in test) + MAVEN_GOAL="test" if [[ -n "${BUILD_SUBDIR}" ]] then echo "Compiling and building all modules for ${BUILD_SUBDIR}" @@ -44,23 +45,19 @@ case ${JOB_TYPE} in echo "Running in subdir: ${BUILD_SUBDIR}" pushd "${BUILD_SUBDIR}" else - # -DskipUnitTests=true skips both compiling and running tests for most client-library - # modules. A few "core" modules (google-auth-library-java, grpc-gcp-java, - # sdk-platform-java) don't honor it, so -DskipTests=true is also passed to stop their - # tests from running, while leaving their test *compilation* alone since other modules - # in the reactor need testlib artifacts (like gax-grpc's) that only that compile step - # produces. - EXTRA_MAVEN_OPTS="${EXTRA_MAVEN_OPTS} -DskipUnitTests=true -DskipTests=true" + # These are pure GAPIC-generated modules with no unit tests to run here; Showcase + # integration tests already cover the generated code's behavior, so this pass only + # needs to confirm everything compiles. + MAVEN_GOAL="compile" fi - echo "EXTRA_MAVEN_OPTS: ${EXTRA_MAVEN_OPTS}" + echo "MAVEN_GOAL: ${MAVEN_GOAL}" retry_with_backoff 3 10 \ - mvn test \ + mvn ${MAVEN_GOAL} \ -B -ntp \ -Pquick-build \ -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \ - -Dmaven.wagon.http.retryHandler.count=5 \ - ${EXTRA_MAVEN_OPTS} + -Dmaven.wagon.http.retryHandler.count=5 RETURN_CODE=$? if [[ -n "${BUILD_SUBDIR}" ]] diff --git a/.kokoro/common.sh b/.kokoro/common.sh index 4980edd1b967..aebe7da62230 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -421,6 +421,7 @@ function install_modules() { printf "Installing submodules:\n%s\n" "$all_submodules" always_install_deps_list=( + 'grpc-gcp-java' 'java-monitoring/google-cloud-monitoring' 'java-monitoring/google-cloud-monitoring-bom' 'google-auth-library-java/appengine' diff --git a/google-cloud-jar-parent/pom.xml b/google-cloud-jar-parent/pom.xml index 4c6f6f9d6d5c..18b905200cd6 100644 --- a/google-cloud-jar-parent/pom.xml +++ b/google-cloud-jar-parent/pom.xml @@ -20,39 +20,19 @@ true ${skipUnitTests} true diff --git a/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml b/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml index 59ff0ddce588..64467207784f 100644 --- a/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml +++ b/sdk-platform-java/gapic-generator-java-pom-parent/pom.xml @@ -25,18 +25,10 @@ modules here (gax-java, gapic-generator-java, java-core, ...) have handwritten tests worth running by default. - skipUnitTests is wired only into surefire's below, not into maven.test.skip, so - -DskipUnitTests=true skips unit test *execution* but never compilation. That's - deliberate: gax-grpc's test-jar is a declared test-scope dependency of java-storage, - java-datastore, java-translate, java-resourcemanager, java-logging, and - java-spanner-jdbc, all of which build in the same root reactor as this hierarchy. - Skipping gax-grpc's test-compile would break their dependency resolution. Contrast - with google-cloud-jar-parent, where skipUnitTests skips compilation too, because GAPIC - test sources have no such cross-hierarchy consumers. - - The enable-integration-tests profile below sets maven.test.skip=false explicitly, so - that flag has the same meaning as in google-cloud-jar-parent when that profile is - active in both hierarchies at once. + Wired only into surefire's below, not maven.test.skip, so -DskipUnitTests=true + skips unit test execution but never compilation: google-cloud-core's test-jar is a + test-scope dependency of several client libraries in the same root reactor, and + skipping its compilation would break their dependency resolution. --> false java.header @@ -255,9 +247,8 @@ bulkTests @@ -265,12 +256,6 @@ true - - enable-integration-tests - - false - -