@@ -167,7 +167,7 @@ func TestDescribeBuildDuration(t *testing.T) {
167
167
Duration : zeroDuration ,
168
168
},
169
169
},
170
- "waiting for 1m0s " ,
170
+ "waiting for 1m " ,
171
171
},
172
172
{ // 1 - build pending
173
173
& buildapi.Build {
@@ -177,7 +177,7 @@ func TestDescribeBuildDuration(t *testing.T) {
177
177
Duration : zeroDuration ,
178
178
},
179
179
},
180
- "waiting for 1m0s " ,
180
+ "waiting for 1m " ,
181
181
},
182
182
{ // 2 - build running
183
183
& buildapi.Build {
@@ -188,7 +188,7 @@ func TestDescribeBuildDuration(t *testing.T) {
188
188
Duration : duration ,
189
189
},
190
190
},
191
- "running for 1m0s " ,
191
+ "running for 1m " ,
192
192
},
193
193
{ // 3 - build completed
194
194
& buildapi.Build {
@@ -200,7 +200,7 @@ func TestDescribeBuildDuration(t *testing.T) {
200
200
Duration : duration ,
201
201
},
202
202
},
203
- "1m0s " ,
203
+ "1m " ,
204
204
},
205
205
{ // 4 - build failed
206
206
& buildapi.Build {
@@ -212,7 +212,7 @@ func TestDescribeBuildDuration(t *testing.T) {
212
212
Duration : duration ,
213
213
},
214
214
},
215
- "1m0s " ,
215
+ "1m " ,
216
216
},
217
217
{ // 5 - build error
218
218
& buildapi.Build {
@@ -224,7 +224,7 @@ func TestDescribeBuildDuration(t *testing.T) {
224
224
Duration : duration ,
225
225
},
226
226
},
227
- "1m0s " ,
227
+ "1m " ,
228
228
},
229
229
{ // 6 - build cancelled before running, start time wasn't set yet
230
230
& buildapi.Build {
@@ -235,7 +235,7 @@ func TestDescribeBuildDuration(t *testing.T) {
235
235
Duration : duration ,
236
236
},
237
237
},
238
- "waited for 2m0s " ,
238
+ "waited for 2m " ,
239
239
},
240
240
{ // 7 - build cancelled while running, start time is set already
241
241
& buildapi.Build {
@@ -247,7 +247,7 @@ func TestDescribeBuildDuration(t *testing.T) {
247
247
Duration : duration ,
248
248
},
249
249
},
250
- "1m0s " ,
250
+ "1m " ,
251
251
},
252
252
{ // 8 - build failed before running, start time wasn't set yet
253
253
& buildapi.Build {
@@ -258,7 +258,7 @@ func TestDescribeBuildDuration(t *testing.T) {
258
258
Duration : duration ,
259
259
},
260
260
},
261
- "waited for 2m0s " ,
261
+ "waited for 2m " ,
262
262
},
263
263
{ // 9 - build error before running, start time wasn't set yet
264
264
& buildapi.Build {
@@ -269,12 +269,12 @@ func TestDescribeBuildDuration(t *testing.T) {
269
269
Duration : duration ,
270
270
},
271
271
},
272
- "waited for 2m0s " ,
272
+ "waited for 2m " ,
273
273
},
274
274
}
275
275
276
276
for i , tc := range tests {
277
- if actual , expected := describeBuildDuration (tc .build ), tc .output ; actual != expected {
277
+ if actual , expected := describeBuildDuration (tc .build ), tc .output ; ! strings . Contains ( actual , expected ) {
278
278
t .Errorf ("(%d) expected duration output %s, got %s" , i , expected , actual )
279
279
}
280
280
}
0 commit comments