1
- const chalk = require ( 'chalk' ) ;
1
+ 'use strict' ;
2
2
3
+ const chalk = require ( 'chalk' ) ;
3
4
const { Job } = require ( './job' ) ;
4
5
const { shortSha } = require ( '../../utils' ) ;
5
6
const {
@@ -46,6 +47,13 @@ class TestBuild extends Job {
46
47
this . builtOn = builtOn ;
47
48
}
48
49
50
+ setDailyBuildData ( { result, changeSet, actions, timestamp, builtOn } ) {
51
+ this . change = changeSet . items [ 0 ] || { } ;
52
+ this . date = new Date ( timestamp ) ;
53
+ this . result = result ;
54
+ this . builtOn = builtOn ;
55
+ }
56
+
49
57
get sourceURL ( ) {
50
58
const { params } = this ;
51
59
@@ -124,7 +132,9 @@ class TestBuild extends Job {
124
132
displayBuilds ( ) {
125
133
const { cli, failures, builds } = this ;
126
134
for ( const failure of failures ) {
127
- this . displayFailure ( failure ) ;
135
+ if ( failure !== undefined ) {
136
+ this . displayFailure ( failure ) ;
137
+ }
128
138
}
129
139
cli . separator ( 'Other builds' ) ;
130
140
for ( const aborted of builds . aborted ) {
@@ -150,6 +160,7 @@ class TestBuild extends Job {
150
160
const { failures } = this ;
151
161
let output = `Failures in job ${ this . jobUrl } \n\n` ;
152
162
for ( const failure of failures ) {
163
+ if ( failure === undefined ) continue ;
153
164
output += `#### [${ getNodeName ( failure . url ) } ](${ failure . url } )` ;
154
165
if ( ! failure . reason . includes ( '\n' ) && failure . reason . length < 20 ) {
155
166
const builtOn = failure . builtOn ? `On ${ failure . builtOn } : ` : '' ;
0 commit comments