]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/single-pod.js
1 /* eslint-disable no-unused-expressions */
5 const chai
= require('chai')
6 const each
= require('async/each')
7 const expect
= chai
.expect
8 const fs
= require('fs')
9 const keyBy
= require('lodash/keyBy')
10 const pathUtils
= require('path')
11 const series
= require('async/series')
12 const webtorrent
= new (require('webtorrent'))()
14 const loginUtils
= require('../utils/login')
15 const miscsUtils
= require('../utils/miscs')
16 const serversUtils
= require('../utils/servers')
17 const videosUtils
= require('../utils/videos')
19 describe('Test a single pod', function () {
23 let videosListBase
= null
25 before(function (done
) {
30 serversUtils
.flushTests(next
)
33 serversUtils
.runServer(1, function (server1
) {
39 loginUtils
.loginAndGetAccessToken(server
, function (err
, token
) {
41 server
.accessToken
= token
48 it('Should list video categories', function (done
) {
49 videosUtils
.getVideoCategories(server
.url
, function (err
, res
) {
52 const categories
= res
.body
53 expect(Object
.keys(categories
)).to
.have
.length
.above(10)
55 expect(categories
[11]).to
.equal('News')
61 it('Should list video licences', function (done
) {
62 videosUtils
.getVideoLicences(server
.url
, function (err
, res
) {
65 const licences
= res
.body
66 expect(Object
.keys(licences
)).to
.have
.length
.above(5)
68 expect(licences
[3]).to
.equal('Attribution - No Derivatives')
74 it('Should list video languages', function (done
) {
75 videosUtils
.getVideoLanguages(server
.url
, function (err
, res
) {
78 const languages
= res
.body
79 expect(Object
.keys(languages
)).to
.have
.length
.above(5)
81 expect(languages
[3]).to
.equal('Mandarin')
87 it('Should not have videos', function (done
) {
88 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
91 expect(res
.body
.total
).to
.equal(0)
92 expect(res
.body
.data
).to
.be
.an('array')
93 expect(res
.body
.data
.length
).to
.equal(0)
99 it('Should upload the video', function (done
) {
100 const videoAttributes
= {
101 name: 'my super name',
105 tags: [ 'tag1', 'tag2', 'tag3' ]
107 videosUtils
.uploadVideo(server
.url
, server
.accessToken
, videoAttributes
, done
)
110 it('Should seed the uploaded video', function (done
) {
111 // Yes, this could be long
114 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
117 expect(res
.body
.total
).to
.equal(1)
118 expect(res
.body
.data
).to
.be
.an('array')
119 expect(res
.body
.data
.length
).to
.equal(1)
121 const video
= res
.body
.data
[0]
122 expect(video
.name
).to
.equal('my super name')
123 expect(video
.category
).to
.equal(2)
124 expect(video
.categoryLabel
).to
.equal('Films')
125 expect(video
.licence
).to
.equal(6)
126 expect(video
.licenceLabel
).to
.equal('Attribution - Non Commercial - No Derivatives')
127 expect(video
.language
).to
.equal(3)
128 expect(video
.languageLabel
).to
.equal('Mandarin')
129 expect(video
.nsfw
).to
.be
.ok
130 expect(video
.description
).to
.equal('my super description')
131 expect(video
.podHost
).to
.equal('localhost:9001')
132 expect(video
.magnetUri
).to
.exist
133 expect(video
.author
).to
.equal('root')
134 expect(video
.isLocal
).to
.be
.true
135 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'tag3' ])
136 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
137 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
139 videosUtils
.testVideoImage(server
.url
, 'video_short.webm', video
.thumbnailPath
, function (err
, test
) {
141 expect(test
).to
.equal(true)
144 videoUUID
= video
.uuid
146 webtorrent
.add(video
.magnetUri
, function (torrent
) {
147 expect(torrent
.files
).to
.exist
148 expect(torrent
.files
.length
).to
.equal(1)
149 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
157 it('Should get the video', function (done
) {
158 // Yes, this could be long
161 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
164 const video
= res
.body
165 expect(video
.name
).to
.equal('my super name')
166 expect(video
.category
).to
.equal(2)
167 expect(video
.categoryLabel
).to
.equal('Films')
168 expect(video
.licence
).to
.equal(6)
169 expect(video
.licenceLabel
).to
.equal('Attribution - Non Commercial - No Derivatives')
170 expect(video
.language
).to
.equal(3)
171 expect(video
.languageLabel
).to
.equal('Mandarin')
172 expect(video
.nsfw
).to
.be
.ok
173 expect(video
.description
).to
.equal('my super description')
174 expect(video
.podHost
).to
.equal('localhost:9001')
175 expect(video
.magnetUri
).to
.exist
176 expect(video
.author
).to
.equal('root')
177 expect(video
.isLocal
).to
.be
.true
178 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'tag3' ])
179 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
180 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
182 videosUtils
.testVideoImage(server
.url
, 'video_short.webm', video
.thumbnailPath
, function (err
, test
) {
184 expect(test
).to
.equal(true)
186 // Wait the async views increment
187 setTimeout(done
, 500)
192 it('Should get the video by UUID', function (done
) {
193 // Yes, this could be long
196 videosUtils
.getVideo(server
.url
, videoUUID
, function (err
, res
) {
199 const video
= res
.body
200 expect(video
.name
).to
.equal('my super name')
202 // Wait the async views increment
203 setTimeout(done
, 500)
207 it('Should have the views updated', function (done
) {
208 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
211 const video
= res
.body
212 expect(video
.views
).to
.equal(2)
218 it('Should search the video by name by default', function (done
) {
219 videosUtils
.searchVideo(server
.url
, 'my', function (err
, res
) {
222 expect(res
.body
.total
).to
.equal(1)
223 expect(res
.body
.data
).to
.be
.an('array')
224 expect(res
.body
.data
.length
).to
.equal(1)
226 const video
= res
.body
.data
[0]
227 expect(video
.name
).to
.equal('my super name')
228 expect(video
.category
).to
.equal(2)
229 expect(video
.categoryLabel
).to
.equal('Films')
230 expect(video
.licence
).to
.equal(6)
231 expect(video
.licenceLabel
).to
.equal('Attribution - Non Commercial - No Derivatives')
232 expect(video
.language
).to
.equal(3)
233 expect(video
.languageLabel
).to
.equal('Mandarin')
234 expect(video
.nsfw
).to
.be
.ok
235 expect(video
.description
).to
.equal('my super description')
236 expect(video
.podHost
).to
.equal('localhost:9001')
237 expect(video
.author
).to
.equal('root')
238 expect(video
.isLocal
).to
.be
.true
239 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'tag3' ])
240 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
241 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
243 videosUtils
.testVideoImage(server
.url
, 'video_short.webm', video
.thumbnailPath
, function (err
, test
) {
245 expect(test
).to
.equal(true)
252 // Not implemented yet
253 // it('Should search the video by podHost', function (done) {
254 // videosUtils.searchVideo(server.url, '9001', 'host', function (err, res) {
255 // if (err) throw err
257 // expect(res.body.total).to.equal(1)
258 // expect(res.body.data).to.be.an('array')
259 // expect(res.body.data.length).to.equal(1)
261 // const video = res.body.data[0]
262 // expect(video.name).to.equal('my super name')
263 // expect(video.description).to.equal('my super description')
264 // expect(video.podHost).to.equal('localhost:9001')
265 // expect(video.author).to.equal('root')
266 // expect(video.isLocal).to.be.true
267 // expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
268 // expect(miscsUtils.dateIsValid(video.createdAt)).to.be.true
269 // expect(miscsUtils.dateIsValid(video.updatedAt)).to.be.true
271 // videosUtils.testVideoImage(server.url, 'video_short.webm', video.thumbnailPath, function (err, test) {
272 // if (err) throw err
273 // expect(test).to.equal(true)
280 it('Should search the video by tag', function (done
) {
281 videosUtils
.searchVideo(server
.url
, 'tag1', 'tags', function (err
, res
) {
284 expect(res
.body
.total
).to
.equal(1)
285 expect(res
.body
.data
).to
.be
.an('array')
286 expect(res
.body
.data
.length
).to
.equal(1)
288 const video
= res
.body
.data
[0]
289 expect(video
.name
).to
.equal('my super name')
290 expect(video
.category
).to
.equal(2)
291 expect(video
.categoryLabel
).to
.equal('Films')
292 expect(video
.licence
).to
.equal(6)
293 expect(video
.licenceLabel
).to
.equal('Attribution - Non Commercial - No Derivatives')
294 expect(video
.language
).to
.equal(3)
295 expect(video
.languageLabel
).to
.equal('Mandarin')
296 expect(video
.nsfw
).to
.be
.ok
297 expect(video
.description
).to
.equal('my super description')
298 expect(video
.podHost
).to
.equal('localhost:9001')
299 expect(video
.author
).to
.equal('root')
300 expect(video
.isLocal
).to
.be
.true
301 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'tag3' ])
302 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
303 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
305 videosUtils
.testVideoImage(server
.url
, 'video_short.webm', video
.thumbnailPath
, function (err
, test
) {
307 expect(test
).to
.equal(true)
314 it('Should not find a search by name by default', function (done
) {
315 videosUtils
.searchVideo(server
.url
, 'hello', function (err
, res
) {
318 expect(res
.body
.total
).to
.equal(0)
319 expect(res
.body
.data
).to
.be
.an('array')
320 expect(res
.body
.data
.length
).to
.equal(0)
326 it('Should not find a search by author', function (done
) {
327 videosUtils
.searchVideo(server
.url
, 'hello', 'author', function (err
, res
) {
330 expect(res
.body
.total
).to
.equal(0)
331 expect(res
.body
.data
).to
.be
.an('array')
332 expect(res
.body
.data
.length
).to
.equal(0)
338 it('Should not find a search by tag', function (done
) {
339 videosUtils
.searchVideo(server
.url
, 'hello', 'tags', function (err
, res
) {
342 expect(res
.body
.total
).to
.equal(0)
343 expect(res
.body
.data
).to
.be
.an('array')
344 expect(res
.body
.data
.length
).to
.equal(0)
350 it('Should remove the video', function (done
) {
351 videosUtils
.removeVideo(server
.url
, server
.accessToken
, videoId
, function (err
) {
354 fs
.readdir(pathUtils
.join(__dirname
, '..', '..', '..', 'test1/videos/'), function (err
, files
) {
357 expect(files
.length
).to
.equal(0)
359 fs
.readdir(pathUtils
.join(__dirname
, '..', '..', '..', 'test1/thumbnails/'), function (err
, files
) {
362 expect(files
.length
).to
.equal(0)
370 it('Should not have videos', function (done
) {
371 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
374 expect(res
.body
.total
).to
.equal(0)
375 expect(res
.body
.data
).to
.be
.an('array')
376 expect(res
.body
.data
.length
).to
.equal(0)
382 it('Should upload 6 videos', function (done
) {
385 'video_short.mp4', 'video_short.ogv', 'video_short.webm',
386 'video_short1.webm', 'video_short2.webm', 'video_short3.webm'
388 each(videos
, function (video
, callbackEach
) {
389 const videoAttributes
= {
390 name: video
+ ' name',
391 description: video
+ ' description',
396 tags: [ 'tag1', 'tag2', 'tag3' ],
400 videosUtils
.uploadVideo(server
.url
, server
.accessToken
, videoAttributes
, callbackEach
)
404 it('Should have the correct durations', function (done
) {
405 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
408 expect(res
.body
.total
).to
.equal(6)
409 const videos
= res
.body
.data
410 expect(videos
).to
.be
.an('array')
411 expect(videos
.length
).to
.equal(6)
413 const videosByName
= keyBy(videos
, 'name')
414 expect(videosByName
['video_short.mp4 name'].duration
).to
.equal(5)
415 expect(videosByName
['video_short.ogv name'].duration
).to
.equal(5)
416 expect(videosByName
['video_short.webm name'].duration
).to
.equal(5)
417 expect(videosByName
['video_short1.webm name'].duration
).to
.equal(10)
418 expect(videosByName
['video_short2.webm name'].duration
).to
.equal(5)
419 expect(videosByName
['video_short3.webm name'].duration
).to
.equal(5)
425 it('Should have the correct thumbnails', function (done
) {
426 videosUtils
.getVideosList(server
.url
, function (err
, res
) {
429 const videos
= res
.body
.data
431 videosListBase
= videos
433 each(videos
, function (video
, callbackEach
) {
435 const videoName
= video
.name
.replace(' name', '')
437 videosUtils
.testVideoImage(server
.url
, videoName
, video
.thumbnailPath
, function (err
, test
) {
440 expect(test
).to
.equal(true)
447 it('Should list only the two first videos', function (done
) {
448 videosUtils
.getVideosListPagination(server
.url
, 0, 2, 'name', function (err
, res
) {
451 const videos
= res
.body
.data
452 expect(res
.body
.total
).to
.equal(6)
453 expect(videos
.length
).to
.equal(2)
454 expect(videos
[0].name
).to
.equal(videosListBase
[0].name
)
455 expect(videos
[1].name
).to
.equal(videosListBase
[1].name
)
461 it('Should list only the next three videos', function (done
) {
462 videosUtils
.getVideosListPagination(server
.url
, 2, 3, 'name', function (err
, res
) {
465 const videos
= res
.body
.data
466 expect(res
.body
.total
).to
.equal(6)
467 expect(videos
.length
).to
.equal(3)
468 expect(videos
[0].name
).to
.equal(videosListBase
[2].name
)
469 expect(videos
[1].name
).to
.equal(videosListBase
[3].name
)
470 expect(videos
[2].name
).to
.equal(videosListBase
[4].name
)
476 it('Should list the last video', function (done
) {
477 videosUtils
.getVideosListPagination(server
.url
, 5, 6, 'name', function (err
, res
) {
480 const videos
= res
.body
.data
481 expect(res
.body
.total
).to
.equal(6)
482 expect(videos
.length
).to
.equal(1)
483 expect(videos
[0].name
).to
.equal(videosListBase
[5].name
)
489 it('Should search the first video', function (done
) {
490 videosUtils
.searchVideoWithPagination(server
.url
, 'webm', 'name', 0, 1, 'name', function (err
, res
) {
493 const videos
= res
.body
.data
494 expect(res
.body
.total
).to
.equal(4)
495 expect(videos
.length
).to
.equal(1)
496 expect(videos
[0].name
).to
.equal('video_short1.webm name')
502 it('Should search the last two videos', function (done
) {
503 videosUtils
.searchVideoWithPagination(server
.url
, 'webm', 'name', 2, 2, 'name', function (err
, res
) {
506 const videos
= res
.body
.data
507 expect(res
.body
.total
).to
.equal(4)
508 expect(videos
.length
).to
.equal(2)
509 expect(videos
[0].name
).to
.equal('video_short3.webm name')
510 expect(videos
[1].name
).to
.equal('video_short.webm name')
516 it('Should search all the webm videos', function (done
) {
517 videosUtils
.searchVideoWithPagination(server
.url
, 'webm', 'name', 0, 15, function (err
, res
) {
520 const videos
= res
.body
.data
521 expect(res
.body
.total
).to
.equal(4)
522 expect(videos
.length
).to
.equal(4)
528 it('Should search all the root author videos', function (done
) {
529 videosUtils
.searchVideoWithPagination(server
.url
, 'root', 'author', 0, 15, function (err
, res
) {
532 const videos
= res
.body
.data
533 expect(res
.body
.total
).to
.equal(6)
534 expect(videos
.length
).to
.equal(6)
540 // Not implemented yet
541 // it('Should search all the 9001 port videos', function (done) {
542 // videosUtils.searchVideoWithPagination(server.url, '9001', 'host', 0, 15, function (err, res) {
543 // if (err) throw err
545 // const videos = res.body.data
546 // expect(res.body.total).to.equal(6)
547 // expect(videos.length).to.equal(6)
553 // it('Should search all the localhost videos', function (done) {
554 // videosUtils.searchVideoWithPagination(server.url, 'localhost', 'host', 0, 15, function (err, res) {
555 // if (err) throw err
557 // const videos = res.body.data
558 // expect(res.body.total).to.equal(6)
559 // expect(videos.length).to.equal(6)
565 it('Should search the right magnetUri video', function (done
) {
566 const video
= videosListBase
[0]
567 videosUtils
.searchVideoWithPagination(server
.url
, encodeURIComponent(video
.magnetUri
), 'magnetUri', 0, 15, function (err
, res
) {
570 const videos
= res
.body
.data
571 expect(res
.body
.total
).to
.equal(1)
572 expect(videos
.length
).to
.equal(1)
573 expect(videos
[0].name
).to
.equal(video
.name
)
579 it('Should list and sort by name in descending order', function (done
) {
580 videosUtils
.getVideosListSort(server
.url
, '-name', function (err
, res
) {
583 const videos
= res
.body
.data
584 expect(res
.body
.total
).to
.equal(6)
585 expect(videos
.length
).to
.equal(6)
586 expect(videos
[0].name
).to
.equal('video_short.webm name')
587 expect(videos
[1].name
).to
.equal('video_short.ogv name')
588 expect(videos
[2].name
).to
.equal('video_short.mp4 name')
589 expect(videos
[3].name
).to
.equal('video_short3.webm name')
590 expect(videos
[4].name
).to
.equal('video_short2.webm name')
591 expect(videos
[5].name
).to
.equal('video_short1.webm name')
597 it('Should search and sort by name in ascending order', function (done
) {
598 videosUtils
.searchVideoWithSort(server
.url
, 'webm', 'name', function (err
, res
) {
601 const videos
= res
.body
.data
602 expect(res
.body
.total
).to
.equal(4)
603 expect(videos
.length
).to
.equal(4)
605 expect(videos
[0].name
).to
.equal('video_short1.webm name')
606 expect(videos
[1].name
).to
.equal('video_short2.webm name')
607 expect(videos
[2].name
).to
.equal('video_short3.webm name')
608 expect(videos
[3].name
).to
.equal('video_short.webm name')
610 videoId
= videos
[2].id
616 it('Should update a video', function (done
) {
618 name: 'my super video updated',
623 description: 'my super description updated',
624 tags: [ 'tagup1', 'tagup2' ]
626 videosUtils
.updateVideo(server
.url
, server
.accessToken
, videoId
, attributes
, done
)
629 it('Should have the video updated', function (done
) {
632 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
635 const video
= res
.body
637 expect(video
.name
).to
.equal('my super video updated')
638 expect(video
.category
).to
.equal(4)
639 expect(video
.categoryLabel
).to
.equal('Art')
640 expect(video
.licence
).to
.equal(2)
641 expect(video
.licenceLabel
).to
.equal('Attribution - Share Alike')
642 expect(video
.language
).to
.equal(5)
643 expect(video
.languageLabel
).to
.equal('Arabic')
644 expect(video
.nsfw
).to
.be
.ok
645 expect(video
.description
).to
.equal('my super description updated')
646 expect(video
.podHost
).to
.equal('localhost:9001')
647 expect(video
.author
).to
.equal('root')
648 expect(video
.isLocal
).to
.be
.true
649 expect(video
.tags
).to
.deep
.equal([ 'tagup1', 'tagup2' ])
650 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
651 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
653 videosUtils
.testVideoImage(server
.url
, 'video_short3.webm', video
.thumbnailPath
, function (err
, test
) {
655 expect(test
).to
.equal(true)
657 webtorrent
.add(video
.magnetUri
, function (torrent
) {
658 expect(torrent
.files
).to
.exist
659 expect(torrent
.files
.length
).to
.equal(1)
660 expect(torrent
.files
[0].path
).to
.exist
.and
.to
.not
.equal('')
668 it('Should update only the tags of a video', function (done
) {
670 tags: [ 'tag1', 'tag2', 'supertag' ]
673 videosUtils
.updateVideo(server
.url
, server
.accessToken
, videoId
, attributes
, function (err
) {
676 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
679 const video
= res
.body
681 expect(video
.name
).to
.equal('my super video updated')
682 expect(video
.category
).to
.equal(4)
683 expect(video
.categoryLabel
).to
.equal('Art')
684 expect(video
.licence
).to
.equal(2)
685 expect(video
.licenceLabel
).to
.equal('Attribution - Share Alike')
686 expect(video
.language
).to
.equal(5)
687 expect(video
.languageLabel
).to
.equal('Arabic')
688 expect(video
.nsfw
).to
.be
.ok
689 expect(video
.description
).to
.equal('my super description updated')
690 expect(video
.podHost
).to
.equal('localhost:9001')
691 expect(video
.author
).to
.equal('root')
692 expect(video
.isLocal
).to
.be
.true
693 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'supertag' ])
694 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
695 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
702 it('Should update only the description of a video', function (done
) {
704 description: 'hello everybody'
707 videosUtils
.updateVideo(server
.url
, server
.accessToken
, videoId
, attributes
, function (err
) {
710 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
713 const video
= res
.body
715 expect(video
.name
).to
.equal('my super video updated')
716 expect(video
.category
).to
.equal(4)
717 expect(video
.categoryLabel
).to
.equal('Art')
718 expect(video
.licence
).to
.equal(2)
719 expect(video
.licenceLabel
).to
.equal('Attribution - Share Alike')
720 expect(video
.language
).to
.equal(5)
721 expect(video
.languageLabel
).to
.equal('Arabic')
722 expect(video
.nsfw
).to
.be
.ok
723 expect(video
.description
).to
.equal('hello everybody')
724 expect(video
.podHost
).to
.equal('localhost:9001')
725 expect(video
.author
).to
.equal('root')
726 expect(video
.isLocal
).to
.be
.true
727 expect(video
.tags
).to
.deep
.equal([ 'tag1', 'tag2', 'supertag' ])
728 expect(miscsUtils
.dateIsValid(video
.createdAt
)).to
.be
.true
729 expect(miscsUtils
.dateIsValid(video
.updatedAt
)).to
.be
.true
736 it('Should like a video', function (done
) {
737 videosUtils
.rateVideo(server
.url
, server
.accessToken
, videoId
, 'like', function (err
) {
740 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
743 const video
= res
.body
745 expect(video
.likes
).to
.equal(1)
746 expect(video
.dislikes
).to
.equal(0)
753 it('Should dislike the same video', function (done
) {
754 videosUtils
.rateVideo(server
.url
, server
.accessToken
, videoId
, 'dislike', function (err
) {
757 videosUtils
.getVideo(server
.url
, videoId
, function (err
, res
) {
760 const video
= res
.body
762 expect(video
.likes
).to
.equal(0)
763 expect(video
.dislikes
).to
.equal(1)
770 after(function (done
) {
771 process
.kill(-server
.app
.pid
)
773 // Keep the logs if the test failed
775 serversUtils
.flushTests(done
)