@@ -33,26 +33,17 @@ if [ -f "${KOKORO_GFILE_DIR}/secret_manager/java-bigqueryconnection-samples-secr
3333 source " ${KOKORO_GFILE_DIR} /secret_manager/java-bigqueryconnection-samples-secrets"
3434fi
3535
36- if [[ -n " ${BUILD_SUBDIR} " ]]
37- then
38- echo " Compiling and building all modules for ${BUILD_SUBDIR} "
39- mvn clean install \
40- -DskipTests \
41- -Dclirr.skip \
42- -Dflatten.skip \
43- -Dcheckstyle.skip \
44- -Djacoco.skip \
45- -Denforcer.skip \
46- --also-make \
47- --projects " ${BUILD_SUBDIR} "
48- echo " Running in subdir: ${BUILD_SUBDIR} "
49- pushd " ${BUILD_SUBDIR} "
50- fi
51-
5236RETURN_CODE=0
5337
5438case ${JOB_TYPE} in
5539 test)
40+ if [[ -n " ${BUILD_SUBDIR} " ]]
41+ then
42+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
43+ install_modules " ${BUILD_SUBDIR} "
44+ echo " Running in subdir: ${BUILD_SUBDIR} "
45+ pushd " ${BUILD_SUBDIR} "
46+ fi
5647 echo " SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT} "
5748 retry_with_backoff 3 10 \
5849 mvn test \
@@ -67,6 +58,12 @@ case ${JOB_TYPE} in
6758 -Dmaven.wagon.http.retryHandler.count=5 \
6859 -T 1C ${SUREFIRE_JVM_OPT}
6960 RETURN_CODE=$?
61+
62+ if [[ -n " ${BUILD_SUBDIR} " ]]
63+ then
64+ echo " restoring directory"
65+ popd
66+ fi
7067 echo " Finished running unit tests"
7168 ;;
7269 integration)
@@ -85,6 +82,41 @@ case ${JOB_TYPE} in
8582 echo " No Integration Tests to run"
8683 fi
8784 ;;
85+ integration-single)
86+ generate_modified_modules_list false
87+ if [[ " $( release_please_snapshot_pull_request) " == " true" ]]; then
88+ echo " Not running integration checks -- this is Release Please SNAPSHOT pull request."
89+ elif [[ ! " ${modified_module_list[*]} " =~ " ${BUILD_SUBDIR} " ]]; then
90+ echo " ${BUILD_SUBDIR} not modified, skipping split integration test"
91+ else
92+ echo " ${BUILD_SUBDIR} modified, running split integration test"
93+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
94+ install_modules " ${BUILD_SUBDIR} "
95+ echo " Running in subdir: ${BUILD_SUBDIR} "
96+ pushd " ${BUILD_SUBDIR} "
97+ echo " SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT} "
98+ echo " INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS} "
99+ mvn verify -Penable-integration-tests \
100+ ${INTEGRATION_TEST_ARGS} \
101+ -B -ntp -fae \
102+ -DtrimStackTrace=false \
103+ -Dclirr.skip=true \
104+ -Denforcer.skip=true \
105+ -Dorg.slf4j.simpleLogger.showDateTime=true \
106+ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
107+ -Dcheckstyle.skip=true \
108+ -Dflatten.skip=true \
109+ -Danimal.sniffer.skip=true \
110+ -Djacoco.skip=true \
111+ -DskipUnitTests=true \
112+ -Dmaven.wagon.http.retryHandler.count=5 \
113+ -T 1C ${SUREFIRE_JVM_OPT}
114+
115+ RETURN_CODE=$?
116+ popd
117+ printf " Finished integration tests for modules:\n%s\n" " ${BUILD_SUBDIR} "
118+ fi
119+ ;;
88120 graalvm-presubmit)
89121 generate_graalvm_presubmit_modules_list
90122 if [[ " $( release_please_snapshot_pull_request) " == " true" ]]; then
@@ -109,7 +141,44 @@ case ${JOB_TYPE} in
109141 echo " Not running GraalVM checks -- No changes in relevant modules"
110142 fi
111143 ;;
144+ graalvm-single)
145+ generate_modified_modules_list false
146+ if [[ " $( release_please_snapshot_pull_request) " == " true" ]]; then
147+ echo " Not running GraalVM checks -- this is Release Please SNAPSHOT pull request."
148+ elif [[ ! " ${modified_module_list[*]} " =~ " ${BUILD_SUBDIR} " ]]; then
149+ echo " ${BUILD_SUBDIR} not modified, skipping split GraalVM test"
150+ else
151+ echo " ${BUILD_SUBDIR} modified, running split GraalVM test"
152+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
153+ install_modules " ${BUILD_SUBDIR} "
154+ echo " Running in subdir: ${BUILD_SUBDIR} "
155+ pushd " ${BUILD_SUBDIR} "
156+ echo " INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS} "
157+ mvn test -Pnative \
158+ ${INTEGRATION_TEST_ARGS} \
159+ -B -ntp -fae \
160+ -DtrimStackTrace=false \
161+ -Dclirr.skip=true \
162+ -Denforcer.skip=true \
163+ -Dorg.slf4j.simpleLogger.showDateTime=true \
164+ -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS \
165+ -Dcheckstyle.skip=true \
166+ -Dflatten.skip=true \
167+ -Danimal.sniffer.skip=true
168+
169+ RETURN_CODE=$?
170+ popd
171+ printf " Finished GraalVM ITs for modules:\n%s\n" " ${BUILD_SUBDIR} "
172+ fi
173+ ;;
112174 lint)
175+ if [[ -n " ${BUILD_SUBDIR} " ]]
176+ then
177+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
178+ install_modules " ${BUILD_SUBDIR} "
179+ echo " Running in subdir: ${BUILD_SUBDIR} "
180+ pushd " ${BUILD_SUBDIR} "
181+ fi
113182 if [ -n " ${BASE_SHA} " ] && [ -n " ${HEAD_SHA} " ]; then
114183 changed_file_list=$( git diff --name-only " ${BASE_SHA} " " ${HEAD_SHA} " )
115184 echo " ${changed_file_list} "
@@ -137,17 +206,17 @@ case ${JOB_TYPE} in
137206 -T 1.5C \
138207 com.spotify.fmt:fmt-maven-plugin:check
139208 mvn -B -ntp checkstyle:check@checkstyle
209+
210+ if [[ -n " ${BUILD_SUBDIR} " ]]
211+ then
212+ echo " restoring directory"
213+ popd
214+ fi
140215 ;;
141216 * ) ;;
142217
143218esac
144219
145- if [[ -n " ${BUILD_SUBDIR} " ]]
146- then
147- echo " restoring directory"
148- popd
149- fi
150-
151220if [ " ${REPORT_COVERAGE} " == " true" ]; then
152221 bash ${KOKORO_GFILE_DIR} /codecov.sh
153222fi
0 commit comments