@@ -217,28 +217,33 @@ def bazelTest = {
217217 checkout scm;
218218 sh label : ' Setup Docker Image' , script : ' docker build -f docker/Dockerfile.bazel -t openroad/bazel-ci .' ;
219219 }
220- withDockerContainer(args : ' -u root -v /var/run/docker.sock:/var/run/docker.sock' , image : ' openroad/bazel-ci:latest' ) {
221- stage(' bazelisk test ...' ) {
222- withCredentials([string(credentialsId : ' bazel-auth-token-b64' , variable : ' BAZEL_AUTH_TOKEN_B64' )]) {
223- timeout(time : 120 , unit : ' MINUTES' ) {
224- def cmd = ' bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic --remote_header="Authorization=Basic $BAZEL_AUTH_TOKEN_B64" --profile=build.profile'
225- try {
226- try {
227- sh label : ' Test, using cached results and building a minimum of dependencies' , script : cmd + ' ...' ;
228- } finally {
229- sh label : ' Analyze build times' , script : ' bazelisk analyze-profile build.profile' ;
230- }
231- } catch (e) {
232- currentBuild. result = ' FAILURE' ;
220+ try {
221+ withDockerContainer(args : ' -u root -v /var/run/docker.sock:/var/run/docker.sock' , image : ' openroad/bazel-ci:latest' ) {
222+ stage(' bazelisk test ...' ) {
223+ withCredentials([string(credentialsId : ' bazel-auth-token-b64' , variable : ' BAZEL_AUTH_TOKEN_B64' )]) {
224+ timeout(time : 120 , unit : ' MINUTES' ) {
225+ def cmd = ' bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic --remote_header="Authorization=Basic $BAZEL_AUTH_TOKEN_B64" --profile=build.profile'
233226 try {
234- sh label : ' Test (keep_going)' , script : cmd + ' --keep_going ...' ;
235- } finally {
236- sh label : ' Analyze build times' , script : ' bazelisk analyze-profile build.profile' ;
227+ try {
228+ sh label : ' Test, using cached results and building a minimum of dependencies' , script : cmd + ' ...' ;
229+ } finally {
230+ sh label : ' Analyze build times' , script : ' bazelisk analyze-profile build.profile' ;
231+ }
232+ } catch (e) {
233+ try {
234+ sh label : ' Test (keep_going)' , script : cmd + ' --keep_going ...' ;
235+ } catch (e2) {
236+ currentBuild. result = ' FAILURE' ;
237+ } finally {
238+ sh label : ' Analyze build times' , script : ' bazelisk analyze-profile build.profile' ;
239+ }
237240 }
238241 }
239242 }
240243 }
241244 }
245+ } catch (IOException e) {
246+ echo " Caught: ${ e} " ;
242247 }
243248 }
244249}
0 commit comments