Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8442827
ci: optimize unit test CI runtime and rename bulk filter
lqiu96 Aug 10, 2026
5d4aabc
Merge branch 'main' into optimize_ci_test_duration
lqiu96 Aug 10, 2026
a1833df
ci: defer bulk unit tests to push and keep parallel install
lqiu96 Aug 10, 2026
38667b3
ci: compile generated modules across Java versions without running un…
lqiu96 Aug 10, 2026
f0e0a0e
ci: restore exact job names for required checks compatibility
lqiu96 Aug 10, 2026
cf72233
ci: rename bulk-filter to generated-libraries-filter
lqiu96 Aug 10, 2026
a94078e
Run GAPIC unit-test CI as compile-only and trim now-unneeded test-ski…
lqiu96 Jul 9, 2026
9d7946b
ci: use JOB_TYPE: test with dynamic goal selection
lqiu96 Aug 10, 2026
9e3ab73
fix(logging-logback): ignore unused protobuf-java dependency
lqiu96 Aug 10, 2026
e8242b0
fix(logging-logback): set skipUnitTests=false for handwritten module
lqiu96 Aug 11, 2026
bd4a48d
Merge branch 'main' of github.com:googleapis/google-cloud-java into o…
lqiu96 Aug 11, 2026
89b57b0
build: override skipUnitTests=false in all handwritten libraries
lqiu96 Aug 11, 2026
680c949
ci: optimize split-dependencies and allow test compilation
lqiu96 Aug 11, 2026
4429a57
fix(graalvm): enable unit tests when native profile is active
lqiu96 Aug 11, 2026
e8fa272
chore(logging-logback): remove redundant ignoredUnusedDeclaredDepende…
lqiu96 Aug 11, 2026
5ceb883
Merge branch 'main' into optimize_ci_test_duration
lqiu96 Aug 11, 2026
050a91a
Merge branch 'main' into optimize_ci_test_duration
lqiu96 Aug 12, 2026
1f028c2
ci: fix testlib classifier race condition and exclude generator from …
lqiu96 Aug 12, 2026
be65643
ci: add api-common-java to always_install_deps and remove isolated ga…
lqiu96 Aug 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 25 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ on:
pull_request:
name: ci
jobs:
# detect whether or note we should run "bulk" (non-handwritten) unit tests
bulk-filter:
# detect whether or not we should run generated (non-handwritten) unit tests
generated-libraries-filter:
runs-on: ubuntu-latest
permissions:
pull-requests: read
Expand Down Expand Up @@ -57,68 +57,64 @@ jobs:
ci:
- '.github/workflows/ci.yaml'
- '.kokoro/**'
# these unit tests are "bulk" (non-handwritten) libraries
# compile all modules across supported Java versions
units:
runs-on: ubuntu-latest
needs: bulk-filter
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
with:
persist-credentials: false
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
with:
distribution: temurin
java-version: ${{matrix.java}}
cache: maven
- run: java -version
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
- run: .kokoro/build.sh
if: ${{ needs.bulk-filter.outputs.runnable == 'true' && (needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true') }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' && (needs.generated-libraries-filter.outputs.src == 'true' || needs.generated-libraries-filter.outputs.ci == 'true') }}
env:
JOB_TYPE: test
JOB_NAME: units-${{matrix.java}}
units-8-runtime:
runs-on: ubuntu-latest
needs: bulk-filter
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
name: "units (8)"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
with:
persist-credentials: false
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
with:
java-version: 8
distribution: temurin
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
with:
java-version: 11
distribution: temurin
cache: maven
- run: .kokoro/build.sh
if: ${{ needs.bulk-filter.outputs.runnable == 'true' && (needs.bulk-filter.outputs.src == 'true' || needs.bulk-filter.outputs.ci == 'true') }}
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' && (needs.generated-libraries-filter.outputs.src == 'true' || needs.generated-libraries-filter.outputs.ci == 'true') }}
shell: bash
env:
JOB_TYPE: test
JOB_NAME: units-8-runtime-${{matrix.java}}
# detect which libraries have changed
changes:
needs: bulk-filter
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
runs-on: ubuntu-latest
permissions:
pull-requests: read
Expand Down Expand Up @@ -349,7 +345,7 @@ jobs:
env:
BUILD_SUBDIR: ${{matrix.package}}
required:
needs: [ bulk-filter, changes, split-units, split-clirr, split-dependencies ]
needs: [ generated-libraries-filter, changes, split-units, split-clirr, split-dependencies ]
name: conditional-required-check
if: ${{ always() }} # Always run even if any "needs" jobs fail
runs-on: ubuntu-22.04
Expand All @@ -360,8 +356,8 @@ jobs:
- name: Success otherwise
run: echo "Success!"
windows:
needs: bulk-filter
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
runs-on: windows-latest
steps:
- name: Support longpaths
Expand All @@ -380,8 +376,8 @@ jobs:
JOB_TYPE: test
JOB_NAME: windows-units
lint:
needs: bulk-filter
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand All @@ -400,8 +396,8 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
enforcer:
needs: bulk-filter
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand All @@ -420,8 +416,8 @@ jobs:
- run: java -version
- run: mvn -B -ntp enforcer:enforce@enforce -T 1C
gapic-libraries-bom:
needs: bulk-filter
if: ${{ needs.bulk-filter.outputs.runnable == 'true' }}
needs: generated-libraries-filter
if: ${{ needs.generated-libraries-filter.outputs.runnable == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
45 changes: 39 additions & 6 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,35 @@ 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}"
install_modules "${BUILD_SUBDIR}"
echo "Running in subdir: ${BUILD_SUBDIR}"
pushd "${BUILD_SUBDIR}"
EXTRA_PROFILE_OPTS=()
EXCLUDE_PROJECTS_OPTS=()
else
EXTRA_PROFILE_OPTS=("-PbulkTests")
# 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"
# gapic-generator-java is a code generation tool tested in its own dedicated workflow
# (sdk-platform-java-ci.yaml). Excluding it from bulk unit test runs saves 2-3 minutes per
# Java runtime matrix job and avoids reactor dependency resolution race conditions.
EXCLUDE_PROJECTS_OPTS=("--projects" "!sdk-platform-java/gapic-generator-java,!sdk-platform-java/gapic-generator-java-pom-parent")
install_modules "sdk-platform-java"
fi
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
echo "MAVEN_GOAL: ${MAVEN_GOAL}"
retry_with_backoff 3 10 \
mvn install \
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 \
--also-make \
${SUREFIRE_JVM_OPT} "${EXTRA_PROFILE_OPTS[@]}"
"${EXCLUDE_PROJECTS_OPTS[@]}" \
-T 1C
RETURN_CODE=$?

if [[ -n "${BUILD_SUBDIR}" ]]
Expand All @@ -67,6 +75,31 @@ case ${JOB_TYPE} in
fi
echo "Finished running unit tests"
;;
compile)
if [[ -n "${BUILD_SUBDIR}" ]]
then
echo "Compiling all modules for ${BUILD_SUBDIR}"
mvn compile \
-B -ntp \
-Pquick-build \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
-Dmaven.wagon.http.retryHandler.count=5 \
--projects "${BUILD_SUBDIR}" \
--also-make \
-T 1C
else
echo "Compiling all modules in repository"
mvn compile \
-B -ntp \
-Pquick-build \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
-Dmaven.wagon.http.retryHandler.count=5 \
-T 1C
fi
RETURN_CODE=$?
;;
install)
if [[ -n "${BUILD_SUBDIR}" ]]
then
Expand Down
2 changes: 2 additions & 0 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,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'
'java-kms/google-cloud-kms'
Expand All @@ -439,6 +440,7 @@ function install_modules() {
'java-iam/proto-google-iam-v3'
'java-iam/proto-google-iam-v3beta'
'gapic-libraries-bom'
'sdk-platform-java/api-common-java'
'sdk-platform-java/java-shared-dependencies'
'sdk-platform-java/java-shared-dependencies/first-party-dependencies'
'sdk-platform-java/java-shared-dependencies/third-party-dependencies'
Expand Down
8 changes: 4 additions & 4 deletions .kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ then
pushd "${BUILD_SUBDIR}"
fi

# this should run maven enforcer
mvn install -B -V -ntp \
-Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false
# this should run maven enforcer and compile test dependencies
mvn test-compile -B -V -ntp \
-Pquick-build -DskipTests=true -Dmaven.javadoc.skip=true -Denforcer.skip=false -T 1C

mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false
mvn -B dependency:analyze -Pquick-build -DfailOnWarning=true -Dmdep.analyze.skip=false -T 1C

if [[ -n "${BUILD_SUBDIR}" ]]
then
Expand Down
18 changes: 17 additions & 1 deletion google-cloud-jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@
<relativePath>../google-cloud-pom-parent/pom.xml</relativePath>
</parent>
<properties>
<skipUnitTests>false</skipUnitTests>
<!--
Defaults to true: most modules under this parent are pure GAPIC-generated clients whose
generated tests aren't worth the CI time. Libraries with handwritten tests worth
running (java-spanner, java-bigtable, java-storage, ...) override this back to false in
their own top-level pom.xml.

Wired only into surefire's <skip> (below), not Maven's built-in skipTests, so it skips
unit tests without also skipping failsafe/ITs.
-->
<skipUnitTests>true</skipUnitTests>
<ignoreNonCompile>true</ignoreNonCompile><!-- maven-dependency-plugin:analyze to skip test scope dependencies -->
</properties>

Expand Down Expand Up @@ -197,6 +206,13 @@
</plugins>
</build>
</profile>
<profile>
<!-- This profile is used to enable GraalVM native image testing -->
<id>native</id>
<properties>
<skipUnitTests>false</skipUnitTests>
</properties>
</profile>
</profiles>

<build>
Expand Down
1 change: 1 addition & 0 deletions java-bigquery-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<description>JDBC for BigQuery</description>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-bigquerystorage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.protobuf-java.version>3.25.4</project.protobuf-java.version>
Expand Down
1 change: 1 addition & 0 deletions java-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-common-protos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-dns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</parent>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
3 changes: 3 additions & 0 deletions java-firestore/google-cloud-firestore-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<artifactId>google-cloud-firestore-parent</artifactId>
<version>3.46.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-firestore:current} -->
</parent>
<properties>
<skipUnitTests>true</skipUnitTests>
</properties>
<dependencies>
<dependency>
<groupId>com.google.api.grpc</groupId>
Expand Down
1 change: 1 addition & 0 deletions java-firestore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-iam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-logging-logback/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</description>

<properties>
<skipUnitTests>false</skipUnitTests>
<logback.version>1.2.13</logback.version>
<easymock.version>5.6.0</easymock.version>
<truth.version>1.4.4</truth.version>
Expand Down
1 change: 1 addition & 0 deletions java-logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
1 change: 1 addition & 0 deletions java-notification/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<relativePath>../google-cloud-jar-parent/pom.xml</relativePath>
</parent>
<properties>
<skipUnitTests>false</skipUnitTests>
<site.installationModule>google-cloud-notification</site.installationModule>
</properties>
<dependencyManagement>
Expand Down
1 change: 1 addition & 0 deletions java-pubsub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
</licenses>

<properties>
<skipUnitTests>false</skipUnitTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.global.server>github</github.global.server>
Expand Down
Loading
Loading