diff --git a/.kokoro/nightly/common.sh b/.kokoro/nightly/common.sh index ee30ec3c74..589ee00bfb 100644 --- a/.kokoro/nightly/common.sh +++ b/.kokoro/nightly/common.sh @@ -13,6 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +# For google-cloud-java, only test specific handwritten libraries included in the monorepo. This is to +# help speed up the execution as building the entire repo is an expensive operation. Specify the nested +# `google-cloud-*` path (except for grafeas as it doesn't have one) because maven -pl will only build the +# specified folder (i.e. parent folder) and ignore all the related sub-modules inside +google_cloud_java_handwritten_maven_args="java-grafeas,java-vertexai/google-cloud-vertexai,java-resourcemanager/google-cloud-resourcemanager,java-translate/google-cloud-translate" + # Checks that the protobuf compatibility scripts provide non-empty input function validate_protobuf_compatibility_script_inputs { # Comma-delimited list of repos to test diff --git a/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh b/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh index 46dd4e967c..55f75496cc 100755 --- a/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh +++ b/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh @@ -76,8 +76,16 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma # Perform testing on main (with latest changes). Shallow copy as history is not important git clone "https://github.com/googleapis/${repo}.git" --depth=1 pushd "${repo}" - # Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control) - mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip + + if [ "${repo}" == "google-cloud-java" ]; then + # The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules) + mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip \ + -pl "${google_cloud_java_handwritten_maven_args}" -am + else + # Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control) + mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip + fi + linkage_checker_arguments="" build_program_arguments "${repo}" diff --git a/.kokoro/nightly/downstream-protobuf-source-compatibility.sh b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh index b718491689..ce377feedd 100755 --- a/.kokoro/nightly/downstream-protobuf-source-compatibility.sh +++ b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh @@ -30,11 +30,25 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma # Compile the Handwritten Library with the Protobuf-Java version to test source compatibility # Run unit tests to help check for any behavior differences (dependant on coverage) - mvn clean test -B -V -ntp \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ + if [ "${repo}" == "google-cloud-java" ]; then + # The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules) + mvn clean test -B -V -ntp \ + -Dclirr.skip \ + -Denforcer.skip \ + -Dmaven.javadoc.skip \ + -Denforcer.skip \ -Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \ + -pl "${google_cloud_java_handwritten_maven_args}" -am \ -T 1C + else + mvn clean test -B -V -ntp \ + -Dclirr.skip \ + -Denforcer.skip \ + -Dmaven.javadoc.skip \ + -Denforcer.skip \ + -Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \ + -T 1C + fi + popd done \ No newline at end of file