@@ -28,18 +28,19 @@ class CITGMBuild extends TestBuild {
2828
2929 this . id = jobid ;
3030 this . noBuild = noBuild ;
31+ this . failures = [ ] ;
3132 }
3233
3334 async getResults ( ) {
34- const { apiUrl } = this ;
35+ const { apiUrl, cli } = this ;
3536
3637 let headerData ;
3738 try {
3839 headerData = await this . getBuildData ( 'Summary' ) ;
3940 } catch ( err ) {
40- this . failures = [
41- new NCUFailure ( { url : this . apiUrl } , err . message )
42- ] ;
41+ cli . stopSpinner ( 'Failed to download Summary data' ,
42+ cli . SPINNER_STATUS . FAILED ) ;
43+ this . failures . push ( new NCUFailure ( { url : this . apiUrl } , err . message ) ) ;
4344 return this . failures ;
4445 }
4546 const { result } = headerData ;
@@ -55,9 +56,9 @@ class CITGMBuild extends TestBuild {
5556 try {
5657 resultData = await this . getBuildData ( 'Results' ) ;
5758 } catch ( err ) {
58- this . failures = [
59- new NCUFailure ( { url : apiUrl } , err . message )
60- ] ;
59+ cli . stopSpinner ( 'Failed to download Results data' ,
60+ cli . SPINNER_STATUS . FAILED ) ;
61+ this . failures . push ( new NCUFailure ( { url : apiUrl } , err . message ) ) ;
6162 return this . failures ;
6263 }
6364
@@ -110,6 +111,20 @@ class CITGMBuild extends TestBuild {
110111 }
111112 }
112113
114+ display ( ) {
115+ const { failures } = this ;
116+
117+ if ( failures . length ) {
118+ for ( const failure of failures ) {
119+ this . displayFailure ( failure ) ;
120+ }
121+ return ;
122+ }
123+
124+ this . displayHeader ( ) ;
125+ this . displayBuilds ( ) ;
126+ }
127+
113128 displayBuilds ( ) {
114129 const { cli, results } = this ;
115130 const { failed, skipped, passed, total } = results . statistics ;
0 commit comments