aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/cli/create-transcoding-job.ts32
1 files changed, 29 insertions, 3 deletions
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts
index e7c36f9c6..c2e3840c5 100644
--- a/server/tests/cli/create-transcoding-job.ts
+++ b/server/tests/cli/create-transcoding-job.ts
@@ -22,6 +22,7 @@ const expect = chai.expect
22 22
23describe('Test create transcoding jobs', function () { 23describe('Test create transcoding jobs', function () {
24 let servers: ServerInfo[] = [] 24 let servers: ServerInfo[] = []
25 let video1UUID: string
25 let video2UUID: string 26 let video2UUID: string
26 27
27 before(async function () { 28 before(async function () {
@@ -36,9 +37,10 @@ describe('Test create transcoding jobs', function () {
36 await doubleFollow(servers[0], servers[1]) 37 await doubleFollow(servers[0], servers[1])
37 38
38 // Upload two videos for our needs 39 // Upload two videos for our needs
39 await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video1' }) 40 const res1 = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video1' })
40 const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video2' }) 41 video1UUID = res1.body.video.uuid
41 video2UUID = res.body.video.uuid 42 const res2 = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video2' })
43 video2UUID = res2.body.video.uuid
42 44
43 await waitJobs(servers) 45 await waitJobs(servers)
44 }) 46 })
@@ -100,6 +102,30 @@ describe('Test create transcoding jobs', function () {
100 } 102 }
101 }) 103 })
102 104
105 it('Should run a transcoding job on video 1 with resolution', async function () {
106 this.timeout(60000)
107
108 const env = getEnvCli(servers[0])
109 await execCLI(`${env} npm run create-transcoding-job -- -v ${video1UUID} -r 480`)
110
111 await waitJobs(servers)
112
113 for (const server of servers) {
114 const res = await getVideosList(server.url)
115 const videos = res.body.data
116 expect(videos).to.have.lengthOf(2)
117
118 const res2 = await getVideo(server.url, video1UUID)
119 const videoDetail: VideoDetails = res2.body
120
121 expect(videoDetail.files).to.have.lengthOf(2)
122
123 expect(videoDetail.files[0].resolution.id).to.equal(720)
124
125 expect(videoDetail.files[1].resolution.id).to.equal(480)
126 }
127 })
128
103 after(async function () { 129 after(async function () {
104 killallServers(servers) 130 killallServers(servers)
105 }) 131 })