@@ -4,7 +4,7 @@ def baseTests(String image) {
44 Map base_tests = [failFast : false ];
55
66 base_tests[' Unit Tests CTest' ] = {
7- withDockerContainer(args : ' -u root -t ' , image : image) {
7+ withDockerContainer(args : ' -u root' , image : image) {
88 stage(' Setup CTest' ) {
99 echo ' Nothing to be done.' ;
1010 }
@@ -43,7 +43,7 @@ def baseTests(String image) {
4343 flow_tests. each { current_test ->
4444 base_tests[" Flow Test - ${ current_test} " ] = {
4545 node {
46- withDockerContainer(args : ' -u root -t ' , image : image) {
46+ withDockerContainer(args : ' -u root' , image : image) {
4747 stage(" Setup ${ current_test} " ) {
4848 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
4949 checkout scm;
@@ -78,7 +78,7 @@ def getParallelTests(String image) {
7878 def ret = [
7979 ' Docs Tester' : {
8080 node {
81- withDockerContainer(args : ' -u root -t ' , image : image) {
81+ withDockerContainer(args : ' -u root' , image : image) {
8282 stage(' Setup Docs Test' ) {
8383 echo " Setting up Docs Tester environment in ${ image} " ;
8484 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
@@ -101,7 +101,7 @@ def getParallelTests(String image) {
101101
102102 ' Build without GUI' : {
103103 node {
104- withDockerContainer(args : ' -u root -t ' , image : image) {
104+ withDockerContainer(args : ' -u root' , image : image) {
105105 stage(' Setup no-GUI Build' ) {
106106 echo " Build without GUI" ;
107107 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
@@ -118,7 +118,7 @@ def getParallelTests(String image) {
118118
119119 ' Build without Test' : {
120120 node {
121- withDockerContainer(args : ' -u root -t ' , image : image) {
121+ withDockerContainer(args : ' -u root' , image : image) {
122122 stage(' Setup no-test Build' ) {
123123 echo " Build without Tests" ;
124124 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
@@ -172,7 +172,7 @@ def getParallelTests(String image) {
172172
173173 ' Unit Tests Ninja' : {
174174 node {
175- withDockerContainer(args : ' -u root -t ' , image : image) {
175+ withDockerContainer(args : ' -u root' , image : image) {
176176 stage(' Setup Ninja Tests' ) {
177177 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
178178 checkout scm;
@@ -195,7 +195,7 @@ def getParallelTests(String image) {
195195
196196 ' Compile with C++20' : {
197197 node {
198- withDockerContainer(args : ' -u root -t ' , image : image) {
198+ withDockerContainer(args : ' -u root' , image : image) {
199199 stage(' Setup C++20 Compile' ) {
200200 sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
201201 checkout scm;
@@ -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 -t -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}
@@ -293,4 +298,4 @@ node {
293298 stage(' Send Email Report' ) {
294299 sendEmail();
295300 }
296- }
301+ }
0 commit comments