diff options
author | Florent F <florent.fayolle69@gmail.com> | 2018-06-15 18:27:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-15 18:27:35 +0200 |
commit | 05623b9030e16449b21a55735fb0451276d61e14 (patch) | |
tree | 37fd3d4178582ccae1514fc98ab0717fc90b4f34 /server | |
parent | f3a2cf8d2f7329c0ac2123c0eb30bfe65d1e9b57 (diff) | |
download | PeerTube-05623b9030e16449b21a55735fb0451276d61e14.tar.gz PeerTube-05623b9030e16449b21a55735fb0451276d61e14.tar.zst PeerTube-05623b9030e16449b21a55735fb0451276d61e14.zip |
Add resolution to create-transcoding-job script (#654)
* Add resolution to create-transcoding-job script
* Requested changes
Diffstat (limited to 'server')
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 32 |
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 | ||
23 | describe('Test create transcoding jobs', function () { | 23 | describe('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 | }) |