1
0
Fork 0

Tests refractoring

This commit is contained in:
Chocobozzz 2016-01-24 16:08:09 +01:00
parent 45239549bf
commit ee66c5930e
6 changed files with 414 additions and 340 deletions

View file

@ -1,6 +1,7 @@
;(function () { ;(function () {
'use strict' 'use strict'
var async = require('async')
var chai = require('chai') var chai = require('chai')
var expect = chai.expect var expect = chai.expect
var request = require('supertest') var request = require('supertest')
@ -11,18 +12,6 @@
var app = null var app = null
var url = '' var url = ''
before(function (done) {
this.timeout(20000)
utils.flushTests(function () {
utils.runServer(1, function (app1, url1) {
app = app1
url = url1
done()
})
})
})
function makePostRequest (path, fields, attach, done, fail) { function makePostRequest (path, fields, attach, done, fail) {
var status_code = 400 var status_code = 400
if (fail !== undefined && fail === false) status_code = 200 if (fail !== undefined && fail === false) status_code = 200
@ -50,6 +39,25 @@
.expect(status_code, done) .expect(status_code, done)
} }
// ---------------------------------------------------------------
before(function (done) {
this.timeout(20000)
async.series([
function (next) {
utils.flushTests(next)
},
function (next) {
utils.runServer(1, function (app1, url1) {
app = app1
url = url1
next()
})
}
], done)
})
describe('Of the pods API', function () { describe('Of the pods API', function () {
var path = '/api/v1/pods/' var path = '/api/v1/pods/'
@ -284,9 +292,7 @@
// Keep the logs if the test failed // Keep the logs if the test failed
if (this.ok) { if (this.ok) {
utils.flushTests(function () { utils.flushTests(done)
done()
})
} else { } else {
done() done()
} }

View file

@ -35,145 +35,190 @@
return utils.getVideosList(urls[pod_number - 1], callback) return utils.getVideosList(urls[pod_number - 1], callback)
} }
// ---------------------------------------------------------------
before(function (done) { before(function (done) {
this.timeout(30000) this.timeout(30000)
utils.runMultipleServers(6, function (apps_run, urls_run) { utils.flushAndRunMultipleServers(6, function (apps_run, urls_run) {
apps = apps_run apps = apps_run
urls = urls_run urls = urls_run
done() done()
}) })
}) })
after(function (done) {
apps.forEach(function (app) {
process.kill(-app.pid)
})
if (this.ok) {
utils.flushTests(function () {
done()
})
} else {
done()
}
})
it('Should make friends with two pod each in a different group', function (done) { it('Should make friends with two pod each in a different group', function (done) {
this.timeout(20000) this.timeout(20000)
// Pod 3 makes friend with the first one async.series([
makeFriends(3, function () { // Pod 3 makes friend with the first one
function (next) {
makeFriends(3, next)
},
// Pod 4 makes friend with the second one // Pod 4 makes friend with the second one
makeFriends(4, function () { function (next) {
// Now if the fifth wants to make friends with the third et the first makeFriends(4, next)
makeFriends(5, function () { },
setTimeout(function () { // Now if the fifth wants to make friends with the third et the first
// It should have 0 friends function (next) {
getFriendsList(5, function (err, res) { makeFriends(5, next)
if (err) throw err },
function (next) {
setTimeout(next, 11000)
}],
function (err) {
if (err) throw err
expect(res.body.length).to.equal(0) // It should have 0 friends
getFriendsList(5, function (err, res) {
if (err) throw err
done() expect(res.body.length).to.equal(0)
})
}, 11000) done()
}) })
}) }
}) )
}) })
it('Should quit all friends', function (done) { it('Should quit all friends', function (done) {
this.timeout(10000) this.timeout(10000)
quitFriends(1, function () {
quitFriends(2, function () { async.series([
function (next) {
quitFriends(1, next)
},
function (next) {
quitFriends(2, next)
}],
function (err) {
if (err) throw err
async.each([ 1, 2, 3, 4, 5, 6 ], function (i, callback) { async.each([ 1, 2, 3, 4, 5, 6 ], function (i, callback) {
getFriendsList(i, function (err, res) { getFriendsList(i, function (err, res) {
if (err) throw err if (err) throw err
expect(res.body.length).to.equal(0) expect(res.body.length).to.equal(0)
callback() callback()
}) })
}, function () { }, done)
done() }
}) )
})
})
}) })
it('Should make friends with the pods 1, 2, 3', function (done) { it('Should make friends with the pods 1, 2, 3', function (done) {
this.timeout(150000) this.timeout(150000)
// Pods 1, 2, 3 and 4 become friends (yes this is beautiful) async.series([
makeFriends(2, function () { // Pods 1, 2, 3 and 4 become friends
makeFriends(1, function () { function (next) {
makeFriends(4, function () { makeFriends(2, next)
// Kill the server 4 },
apps[3].kill() function (next) {
makeFriends(1, next)
// Expulse pod 4 from pod 1 and 2 },
uploadVideo(1, function () { function (next) {
uploadVideo(2, function () { makeFriends(4, next)
setTimeout(function () { },
uploadVideo(1, function () { // Kill pod 4
uploadVideo(2, function () { function (next) {
setTimeout(function () { apps[3].kill()
// Rerun server 4 next()
utils.runServer(4, function (app, url) { },
apps[3] = app // Expulse pod 4 from pod 1 and 2
getFriendsList(4, function (err, res) { function (next) {
if (err) throw err uploadVideo(1, next)
// Pod 4 didn't know pod 1 and 2 removed it },
expect(res.body.length).to.equal(3) function (next) {
uploadVideo(2, next)
// Pod 6 ask pod 1, 2 and 3 },
makeFriends(6, function () { function (next) {
getFriendsList(6, function (err, res) { setTimeout(next, 11000)
if (err) throw err },
function (next) {
// Pod 4 should not be our friend uploadVideo(1, next)
var result = res.body },
expect(result.length).to.equal(3) function (next) {
for (var pod of result) { uploadVideo(2, next)
expect(pod.url).not.equal(urls[3]) },
} function (next) {
setTimeout(next, 20000)
done() },
}) // Rerun server 4
}) function (next) {
}) utils.runServer(4, function (app, url) {
}) apps[3] = app
}, 15000) next()
})
})
}, 11000)
})
})
}) })
}) },
}) function (next) {
getFriendsList(4, function (err, res) {
if (err) throw err
// Pod 4 didn't know pod 1 and 2 removed it
expect(res.body.length).to.equal(3)
next()
})
},
// Pod 6 ask pod 1, 2 and 3
function (next) {
makeFriends(6, next)
}],
function (err) {
if (err) throw err
getFriendsList(6, function (err, res) {
if (err) throw err
// Pod 4 should not be our friend
var result = res.body
expect(result.length).to.equal(3)
for (var pod of result) {
expect(pod.url).not.equal(urls[3])
}
done()
})
}
)
}) })
it('Should pod 1 quit friends', function (done) { it('Should pod 1 quit friends', function (done) {
this.timeout(25000) this.timeout(25000)
// Upload a video on server 3 for aditionnal tests
uploadVideo(3, function () {
setTimeout(function () {
quitFriends(1, function () {
// Remove pod 1 from pod 2
getVideos(1, function (err, res) {
if (err) throw err
expect(res.body).to.be.an('array')
expect(res.body.length).to.equal(2)
getVideos(2, function (err, res) { async.series([
if (err) throw err // Upload a video on server 3 for aditionnal tests
expect(res.body).to.be.an('array') function (next) {
expect(res.body.length).to.equal(3) uploadVideo(3, next)
done() },
}) function (next) {
}) setTimeout(next, 15000)
},
function (next) {
quitFriends(1, next)
},
// Remove pod 1 from pod 2
function (next) {
getVideos(1, function (err, res) {
if (err) throw err
expect(res.body).to.be.an('array')
expect(res.body.length).to.equal(2)
next()
}) })
}, 15000) }],
}) function (err) {
if (err) throw err
getVideos(2, function (err, res) {
if (err) throw err
expect(res.body).to.be.an('array')
expect(res.body.length).to.equal(3)
done()
})
}
)
}) })
it('Should make friends between pod 1 and 2 and exchange their videos', function (done) { it('Should make friends between pod 1 and 2 and exchange their videos', function (done) {
@ -191,5 +236,17 @@
}, 5000) }, 5000)
}) })
}) })
after(function (done) {
apps.forEach(function (app) {
process.kill(-app.pid)
})
if (this.ok) {
utils.flushTests(done)
} else {
done()
}
})
}) })
})() })()

View file

@ -9,6 +9,9 @@
var utils = require('./utils') var utils = require('./utils')
describe('Test basic friends', function () { describe('Test basic friends', function () {
var apps = []
var urls = []
function testMadeFriends (urls, url_to_test, callback) { function testMadeFriends (urls, url_to_test, callback) {
var friends = [] var friends = []
for (var i = 0; i < urls.length; i++) { for (var i = 0; i < urls.length; i++) {
@ -32,12 +35,11 @@
}) })
} }
var apps = [] // ---------------------------------------------------------------
var urls = []
before(function (done) { before(function (done) {
this.timeout(20000) this.timeout(20000)
utils.runMultipleServers(3, function (apps_run, urls_run) { utils.flushAndRunMultipleServers(3, function (apps_run, urls_run) {
apps = apps_run apps = apps_run
urls = urls_run urls = urls_run
done() done()
@ -54,11 +56,7 @@
expect(result.length).to.equal(0) expect(result.length).to.equal(0)
callback() callback()
}) })
}, function (err) { }, done)
if (err) throw err
done()
})
}) })
it('Should make friends', function (done) { it('Should make friends', function (done) {
@ -66,56 +64,65 @@
var path = '/api/v1/pods/makefriends' var path = '/api/v1/pods/makefriends'
// The second pod make friend with the third async.series([
request(urls[1]) // The second pod make friend with the third
.get(path) function (next) {
.set('Accept', 'application/json') request(urls[1])
.expect(204) .get(path)
.end(function (err, res) { .set('Accept', 'application/json')
if (err) throw err .expect(204)
.end(next)
},
// Wait for the request between pods
function (next) {
setTimeout(next, 1000)
},
// The second pod should have the third as a friend
function (next) {
utils.getFriendsList(urls[1], function (err, res) {
if (err) throw err
// Wait for the request between pods var result = res.body
setTimeout(function () { expect(result).to.be.an('array')
// The second pod should have the third as a friend expect(result.length).to.equal(1)
utils.getFriendsList(urls[1], function (err, res) { expect(result[0].url).to.be.equal(urls[2])
if (err) throw err
var result = res.body next()
expect(result).to.be.an('array') })
expect(result.length).to.equal(1) },
expect(result[0].url).to.be.equal(urls[2]) // Same here, the third pod should have the second pod as a friend
function (next) {
utils.getFriendsList(urls[2], function (err, res) {
if (err) throw err
// Same here, the third pod should have the second pod as a friend var result = res.body
utils.getFriendsList(urls[2], function (err, res) { expect(result).to.be.an('array')
if (err) throw err expect(result.length).to.equal(1)
expect(result[0].url).to.be.equal(urls[1])
var result = res.body next()
expect(result).to.be.an('array') })
expect(result.length).to.equal(1) },
expect(result[0].url).to.be.equal(urls[1]) // Finally the first pod make friend with the second pod
function (next) {
// Finally the first pod make friend with the second pod request(urls[0])
request(urls[0]) .get(path)
.get(path) .set('Accept', 'application/json')
.set('Accept', 'application/json') .expect(204)
.expect(204) .end(next)
.end(function (err, res) { },
if (err) throw err // Wait for the request between pods
function (next) {
setTimeout(function () { setTimeout(next, 1000)
// Now each pod should be friend with the other ones }
async.each(urls, function (url, callback) { ],
testMadeFriends(urls, url, callback) // Now each pod should be friend with the other ones
}, function (err) { function (err) {
if (err) throw err if (err) throw err
done() async.each(urls, function (url, callback) {
}) testMadeFriends(urls, url, callback)
}, 1000) }, done)
}) })
})
})
}, 1000)
})
}) })
it('Should not be allowed to make friend again', function (done) { it('Should not be allowed to make friend again', function (done) {
@ -123,15 +130,25 @@
}) })
it('Should quit friends of pod 2', function (done) { it('Should quit friends of pod 2', function (done) {
utils.quitFriends(urls[1], function () { async.series([
utils.getFriendsList(urls[1], function (err, res) { // Pod 1 quit friends
if (err) throw err function (next) {
utils.quitFriends(urls[1], next)
},
// Pod 1 should not have friends anymore
function (next) {
utils.getFriendsList(urls[1], function (err, res) {
if (err) throw err
var result = res.body var result = res.body
expect(result).to.be.an('array') expect(result).to.be.an('array')
expect(result.length).to.equal(0) expect(result.length).to.equal(0)
// Other pods shouldn't have pod 2 too next()
})
},
// Other pods shouldn't have pod 1 too
function (next) {
async.each([ urls[0], urls[2] ], function (url, callback) { async.each([ urls[0], urls[2] ], function (url, callback) {
utils.getFriendsList(url, function (err, res) { utils.getFriendsList(url, function (err, res) {
if (err) throw err if (err) throw err
@ -142,22 +159,16 @@
expect(result[0].url).not.to.be.equal(urls[1]) expect(result[0].url).not.to.be.equal(urls[1])
callback() callback()
}) })
}, function (err) { }, next)
if (err) throw err }
done() ], done)
})
})
})
}) })
it('Should allow pod 2 to make friend again', function (done) { it('Should allow pod 2 to make friend again', function (done) {
utils.makeFriends(urls[1], function () { utils.makeFriends(urls[1], function () {
async.each(urls, function (url, callback) { async.each(urls, function (url, callback) {
testMadeFriends(urls, url, callback) testMadeFriends(urls, url, callback)
}, function (err) { }, done)
if (err) throw err
done()
})
}) })
}) })
@ -167,9 +178,7 @@
}) })
if (this.ok) { if (this.ok) {
utils.flushTests(function () { utils.flushTests(done)
done()
})
} else { } else {
done() done()
} }

View file

@ -17,26 +17,31 @@
before(function (done) { before(function (done) {
this.timeout(30000) this.timeout(30000)
utils.runMultipleServers(3, function (apps_run, urls_run) { async.series([
apps = apps_run // Run servers
urls = urls_run function (next) {
utils.flushAndRunMultipleServers(3, function (apps_run, urls_run) {
apps = apps_run
urls = urls_run
next()
})
},
// The second pod make friend with the third // The second pod make friend with the third
utils.makeFriends(urls[1], function (err, res) { function (next) {
if (err) throw err utils.makeFriends(urls[1], next)
},
// Wait for the request between pods // Wait for the request between pods
setTimeout(function () { function (next) {
utils.makeFriends(urls[0], function (err, res) { setTimeout(next, 10000)
if (err) throw err },
// Pod 1 make friends too
webtorrent.create({ host: 'client', port: '1' }, function () { function (next) {
done() utils.makeFriends(urls[0], next)
}) },
}) function (next) {
}, 10000) webtorrent.create({ host: 'client', port: '1' }, next)
}) }
}) ], done)
}) })
it('Should not have videos for all pods', function (done) { it('Should not have videos for all pods', function (done) {
@ -49,22 +54,24 @@
callback() callback()
}) })
}, function (err) { }, done)
if (err) throw err
done()
})
}) })
describe('Should upload the video and propagate on each pod', function () { describe('Should upload the video and propagate on each pod', function () {
it('Should upload the video on pod 1 and propagate on each pod', function (done) { it('Should upload the video on pod 1 and propagate on each pod', function (done) {
this.timeout(15000) this.timeout(15000)
utils.uploadVideo(urls[0], 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', function (err) { async.series([
if (err) throw err function (next) {
utils.uploadVideo(urls[0], 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next)
},
function (next) {
setTimeout(next, 11000)
}],
// All pods should have this video
function (err) {
if (err) throw err
setTimeout(function () {
// All pods should have this video
async.each(urls, function (url, callback) { async.each(urls, function (url, callback) {
var base_magnet = null var base_magnet = null
@ -89,23 +96,25 @@
callback() callback()
}) })
}, function (err) { }, done)
if (err) throw err }
)
done()
})
}, 11000)
})
}) })
it('Should upload the video on pod 2 and propagate on each pod', function (done) { it('Should upload the video on pod 2 and propagate on each pod', function (done) {
this.timeout(15000) this.timeout(15000)
utils.uploadVideo(urls[1], 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', function (err) { async.series([
if (err) throw err function (next) {
utils.uploadVideo(urls[1], 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next)
},
function (next) {
setTimeout(next, 11000)
}],
// All pods should have this video
function (err) {
if (err) throw err
setTimeout(function () {
// All pods should have this video
async.each(urls, function (url, callback) { async.each(urls, function (url, callback) {
var base_magnet = null var base_magnet = null
@ -130,62 +139,60 @@
callback() callback()
}) })
}, function (err) { }, done)
if (err) throw err }
)
done()
})
}, 11000)
})
}) })
it('Should upload two videos on pod 3 and propagate on each pod', function (done) { it('Should upload two videos on pod 3 and propagate on each pod', function (done) {
this.timeout(30000) this.timeout(30000)
utils.uploadVideo(urls[2], 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', function (err) { async.series([
if (err) throw err function (next) {
utils.uploadVideo(urls[2], 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', function (err) { utils.uploadVideo(urls[2], 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next)
},
function (next) {
utils.uploadVideo(urls[2], 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next)
},
function (next) {
setTimeout(next, 22000)
}],
function (err) {
if (err) throw err if (err) throw err
setTimeout(function () { var base_magnet = null
var base_magnet = null // All pods should have this video
// All pods should have this video async.each(urls, function (url, callback) {
async.each(urls, function (url, callback) { utils.getVideosList(url, function (err, res) {
utils.getVideosList(url, function (err, res) {
if (err) throw err
var videos = res.body
expect(videos).to.be.an('array')
expect(videos.length).to.equal(4)
var video = videos[2]
expect(video.name).to.equal('my super name for pod 3')
expect(video.description).to.equal('my super description for pod 3')
expect(video.podUrl).to.equal('http://localhost:9003')
expect(video.magnetUri).to.exist
video = videos[3]
expect(video.name).to.equal('my super name for pod 3-2')
expect(video.description).to.equal('my super description for pod 3-2')
expect(video.podUrl).to.equal('http://localhost:9003')
expect(video.magnetUri).to.exist
// All pods should have the same magnet Uri
if (base_magnet === null) {
base_magnet = video.magnetUri
} else {
expect(video.magnetUri).to.equal.magnetUri
}
callback()
})
}, function (err) {
if (err) throw err if (err) throw err
done() var videos = res.body
expect(videos).to.be.an('array')
expect(videos.length).to.equal(4)
var video = videos[2]
expect(video.name).to.equal('my super name for pod 3')
expect(video.description).to.equal('my super description for pod 3')
expect(video.podUrl).to.equal('http://localhost:9003')
expect(video.magnetUri).to.exist
video = videos[3]
expect(video.name).to.equal('my super name for pod 3-2')
expect(video.description).to.equal('my super description for pod 3-2')
expect(video.podUrl).to.equal('http://localhost:9003')
expect(video.magnetUri).to.exist
// All pods should have the same magnet Uri
if (base_magnet === null) {
base_magnet = video.magnetUri
} else {
expect(video.magnetUri).to.equal.magnetUri
}
callback()
}) })
}, 22000) }, done)
}) }
}) )
}) })
}) })
@ -271,17 +278,18 @@
it('Should remove the file 3 and 3-2 by asking pod 3', function (done) { it('Should remove the file 3 and 3-2 by asking pod 3', function (done) {
this.timeout(15000) this.timeout(15000)
utils.removeVideo(urls[2], to_remove[0], function (err) { async.series([
if (err) throw err function (next) {
utils.removeVideo(urls[2], to_remove[1], function (err) { utils.removeVideo(urls[2], to_remove[0], next)
},
function (next) {
utils.removeVideo(urls[2], to_remove[1], next)
}],
function (err) {
if (err) throw err if (err) throw err
setTimeout(done, 11000)
// Wait the propagation to the other pods }
setTimeout(function () { )
done()
}, 11000)
})
})
}) })
it('Should have videos 1 and 3 on each pod', function (done) { it('Should have videos 1 and 3 on each pod', function (done) {
@ -300,11 +308,7 @@
callback() callback()
}) })
}, function (err) { }, done)
if (err) throw err
done()
})
}) })
}) })
@ -316,9 +320,7 @@
// Keep the logs if the test failed // Keep the logs if the test failed
if (this.ok) { if (this.ok) {
utils.flushTests(function () { utils.flushTests(done)
done()
})
} else { } else {
done() done()
} }

View file

@ -1,6 +1,7 @@
;(function () { ;(function () {
'use strict' 'use strict'
var async = require('async')
var chai = require('chai') var chai = require('chai')
var fs = require('fs') var fs = require('fs')
var expect = chai.expect var expect = chai.expect
@ -18,16 +19,21 @@
before(function (done) { before(function (done) {
this.timeout(20000) this.timeout(20000)
utils.flushTests(function () { async.series([
utils.runServer(1, function (app1, url1) { function (next) {
app = app1 utils.flushTests(next)
url = url1 },
function (next) {
webtorrent.create({ host: 'client', port: '1' }, function () { utils.runServer(1, function (app1, url1) {
done() app = app1
url = url1
next()
}) })
}) },
}) function (next) {
webtorrent.create({ host: 'client', port: '1' }, next)
}
], done)
}) })
it('Should not have videos', function (done) { it('Should not have videos', function (done) {
@ -132,9 +138,7 @@
// Keep the logs if the test failed // Keep the logs if the test failed
if (this.ok) { if (this.ok) {
utils.flushTests(function () { utils.flushTests(done)
done()
})
} else { } else {
done() done()
} }

View file

@ -6,10 +6,23 @@
var fork = child_process.fork var fork = child_process.fork
var request = require('supertest') var request = require('supertest')
module.exports = {
flushTests: flushTests,
getFriendsList: getFriendsList,
getVideosList: getVideosList,
makeFriends: makeFriends,
quitFriends: quitFriends,
removeVideo: removeVideo,
flushAndRunMultipleServers: flushAndRunMultipleServers,
runServer: runServer,
searchVideo: searchVideo,
uploadVideo: uploadVideo
}
// ---------------------- Export functions --------------------
function flushTests (callback) { function flushTests (callback) {
exec(__dirname + '/../../scripts/clean_test.sh', function () { exec(__dirname + '/../../scripts/clean_test.sh', callback)
callback()
})
} }
function getFriendsList (url, end) { function getFriendsList (url, end) {
@ -51,9 +64,7 @@
if (err) throw err if (err) throw err
// Wait for the request between pods // Wait for the request between pods
setTimeout(function () { setTimeout(callback, 1000)
callback()
}, 1000)
}) })
} }
@ -69,25 +80,10 @@
if (err) throw err if (err) throw err
// Wait for the request between pods // Wait for the request between pods
setTimeout(function () { setTimeout(callback, 1000)
callback()
}, 1000)
}) })
} }
function uploadVideo (url, name, description, fixture, end) {
var path = '/api/v1/videos'
request(url)
.post(path)
.set('Accept', 'application/json')
.field('name', name)
.field('description', description)
.attach('input_video', __dirname + '/fixtures/' + fixture)
.expect(201)
.end(end)
}
function removeVideo (url, id, end) { function removeVideo (url, id, end) {
var path = '/api/v1/videos' var path = '/api/v1/videos'
@ -98,7 +94,7 @@
.end(end) .end(end)
} }
function runMultipleServers (total_servers, serversRun) { function flushAndRunMultipleServers (total_servers, serversRun) {
var apps = [] var apps = []
var urls = [] var urls = []
var i = 0 var i = 0
@ -171,16 +167,16 @@
.end(end) .end(end)
} }
module.exports = { function uploadVideo (url, name, description, fixture, end) {
flushTests: flushTests, var path = '/api/v1/videos'
getFriendsList: getFriendsList,
getVideosList: getVideosList, request(url)
makeFriends: makeFriends, .post(path)
quitFriends: quitFriends, .set('Accept', 'application/json')
removeVideo: removeVideo, .field('name', name)
runMultipleServers: runMultipleServers, .field('description', description)
runServer: runServer, .attach('input_video', __dirname + '/fixtures/' + fixture)
searchVideo: searchVideo, .expect(201)
uploadVideo: uploadVideo .end(end)
} }
})() })()