@@ -33,18 +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- install_modules " ${BUILD_SUBDIR} "
40- echo " Running in subdir: ${BUILD_SUBDIR} "
41- pushd " ${BUILD_SUBDIR} "
42- fi
43-
4436RETURN_CODE=0
4537
4638case ${JOB_TYPE} in
4739 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
4847 echo " SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT} "
4948 retry_with_backoff 3 10 \
5049 mvn test \
@@ -59,6 +58,12 @@ case ${JOB_TYPE} in
5958 -Dmaven.wagon.http.retryHandler.count=5 \
6059 -T 1C ${SUREFIRE_JVM_OPT}
6160 RETURN_CODE=$?
61+
62+ if [[ -n " ${BUILD_SUBDIR} " ]]
63+ then
64+ echo " restoring directory"
65+ popd
66+ fi
6267 echo " Finished running unit tests"
6368 ;;
6469 integration)
@@ -83,6 +88,10 @@ case ${JOB_TYPE} in
8388 echo " ${BUILD_SUBDIR} not modified, skipping split integration test"
8489 else
8590 echo " ${BUILD_SUBDIR} modified, running split integration test"
91+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
92+ install_modules " ${BUILD_SUBDIR} "
93+ echo " Running in subdir: ${BUILD_SUBDIR} "
94+ pushd " ${BUILD_SUBDIR} "
8695 echo " SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT} "
8796 echo " INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS} "
8897 mvn verify -Penable-integration-tests \
@@ -102,6 +111,7 @@ case ${JOB_TYPE} in
102111 -T 1C ${SUREFIRE_JVM_OPT}
103112
104113 RETURN_CODE=$?
114+ popd
105115 printf " Finished integration tests for modules:\n%s\n" " ${BUILD_SUBDIR} "
106116 fi
107117 ;;
@@ -130,11 +140,15 @@ case ${JOB_TYPE} in
130140 fi
131141 ;;
132142 graalvm-single)
133- generate_modified_modules_list false
143+ generate_modified_modules_list false
134144 if [[ ! " ${modified_module_list[*]} " =~ " ${BUILD_SUBDIR} " ]]; then
135145 echo " ${BUILD_SUBDIR} not modified, skipping split GraalVM test"
136146 else
137147 echo " ${BUILD_SUBDIR} modified, running split GraalVM test"
148+ echo " Compiling and building all modules for ${BUILD_SUBDIR} "
149+ install_modules " ${BUILD_SUBDIR} "
150+ echo " Running in subdir: ${BUILD_SUBDIR} "
151+ pushd " ${BUILD_SUBDIR} "
138152 echo " INTEGRATION_TEST_ARGS: ${INTEGRATION_TEST_ARGS} "
139153 mvn test -Pnative \
140154 ${INTEGRATION_TEST_ARGS} \
@@ -149,6 +163,7 @@ case ${JOB_TYPE} in
149163 -Danimal.sniffer.skip=true
150164
151165 RETURN_CODE=$?
166+ popd
152167 printf " Finished GraalVM ITs for modules:\n%s\n" " ${BUILD_SUBDIR} "
153168 fi
154169 ;;
@@ -185,12 +200,6 @@ case ${JOB_TYPE} in
185200
186201esac
187202
188- if [[ -n " ${BUILD_SUBDIR} " ]]
189- then
190- echo " restoring directory"
191- popd
192- fi
193-
194203if [ " ${REPORT_COVERAGE} " == " true" ]; then
195204 bash ${KOKORO_GFILE_DIR} /codecov.sh
196205fi
0 commit comments