Skip to content

Commit b8293ef

Browse files
authored
ci: Speed up Protobuf Compatibility checks by running specific modules in Google-Cloud-Java (#3683)
Run from this speed-up for google-cloud-java: https://github.com/googleapis/sdk-platform-java/actions/runs/13845404432/job/38742611238 Google-cloud-java is able to run linkage checker on the handwritten modules in ~4 min. Slowest is now bigquerystorage that runs in ~10 min
1 parent 02c61cf commit b8293ef

3 files changed

+34
-6
lines changed

.kokoro/nightly/common.sh

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
# For google-cloud-java, only test specific handwritten libraries included in the monorepo. This is to
17+
# help speed up the execution as building the entire repo is an expensive operation. Specify the nested
18+
# `google-cloud-*` path (except for grafeas as it doesn't have one) because maven -pl will only build the
19+
# specified folder (i.e. parent folder) and ignore all the related sub-modules inside
20+
google_cloud_java_handwritten_maven_args="java-grafeas,java-vertexai/google-cloud-vertexai,java-resourcemanager/google-cloud-resourcemanager,java-translate/google-cloud-translate"
21+
1622
# Checks that the protobuf compatibility scripts provide non-empty input
1723
function validate_protobuf_compatibility_script_inputs {
1824
# Comma-delimited list of repos to test

.kokoro/nightly/downstream-protobuf-binary-compatibility.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
7676
# Perform testing on main (with latest changes). Shallow copy as history is not important
7777
git clone "https://github.com/googleapis/${repo}.git" --depth=1
7878
pushd "${repo}"
79-
# Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
80-
mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
79+
80+
if [ "${repo}" == "google-cloud-java" ]; then
81+
# The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules)
82+
mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip \
83+
-pl "${google_cloud_java_handwritten_maven_args}" -am
84+
else
85+
# Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
86+
mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip
87+
fi
88+
8189

8290
linkage_checker_arguments=""
8391
build_program_arguments "${repo}"

.kokoro/nightly/downstream-protobuf-source-compatibility.sh

+18-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,25 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
3030

3131
# Compile the Handwritten Library with the Protobuf-Java version to test source compatibility
3232
# Run unit tests to help check for any behavior differences (dependant on coverage)
33-
mvn clean test -B -V -ntp \
34-
-Dclirr.skip=true \
35-
-Denforcer.skip=true \
36-
-Dmaven.javadoc.skip=true \
33+
if [ "${repo}" == "google-cloud-java" ]; then
34+
# The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules)
35+
mvn clean test -B -V -ntp \
36+
-Dclirr.skip \
37+
-Denforcer.skip \
38+
-Dmaven.javadoc.skip \
39+
-Denforcer.skip \
3740
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
41+
-pl "${google_cloud_java_handwritten_maven_args}" -am \
3842
-T 1C
43+
else
44+
mvn clean test -B -V -ntp \
45+
-Dclirr.skip \
46+
-Denforcer.skip \
47+
-Dmaven.javadoc.skip \
48+
-Denforcer.skip \
49+
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
50+
-T 1C
51+
fi
52+
3953
popd
4054
done

0 commit comments

Comments
 (0)