aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/create-transcoding-job.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/cli/create-transcoding-job.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/cli/create-transcoding-job.ts')
-rw-r--r--server/tests/cli/create-transcoding-job.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts
index f629306e6..c9bbab802 100644
--- a/server/tests/cli/create-transcoding-job.ts
+++ b/server/tests/cli/create-transcoding-job.ts
@@ -42,12 +42,12 @@ describe('Test create transcoding jobs', function () {
42 servers = await flushAndRunMultipleServers(2) 42 servers = await flushAndRunMultipleServers(2)
43 await setAccessTokensToServers(servers) 43 await setAccessTokensToServers(servers)
44 44
45 await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) 45 await servers[0].config.updateCustomSubConfig({ newConfig: config })
46 46
47 await doubleFollow(servers[0], servers[1]) 47 await doubleFollow(servers[0], servers[1])
48 48
49 for (let i = 1; i <= 5; i++) { 49 for (let i = 1; i <= 5; i++) {
50 const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video' + i } }) 50 const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video' + i } })
51 videosUUID.push(uuid) 51 videosUUID.push(uuid)
52 } 52 }
53 53
@@ -58,11 +58,11 @@ describe('Test create transcoding jobs', function () {
58 this.timeout(30000) 58 this.timeout(30000)
59 59
60 for (const server of servers) { 60 for (const server of servers) {
61 const { data } = await server.videosCommand.list() 61 const { data } = await server.videos.list()
62 expect(data).to.have.lengthOf(videosUUID.length) 62 expect(data).to.have.lengthOf(videosUUID.length)
63 63
64 for (const video of data) { 64 for (const video of data) {
65 const videoDetail = await server.videosCommand.get({ id: video.uuid }) 65 const videoDetail = await server.videos.get({ id: video.uuid })
66 expect(videoDetail.files).to.have.lengthOf(1) 66 expect(videoDetail.files).to.have.lengthOf(1)
67 expect(videoDetail.streamingPlaylists).to.have.lengthOf(0) 67 expect(videoDetail.streamingPlaylists).to.have.lengthOf(0)
68 } 68 }
@@ -72,16 +72,16 @@ describe('Test create transcoding jobs', function () {
72 it('Should run a transcoding job on video 2', async function () { 72 it('Should run a transcoding job on video 2', async function () {
73 this.timeout(60000) 73 this.timeout(60000)
74 74
75 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`) 75 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`)
76 await waitJobs(servers) 76 await waitJobs(servers)
77 77
78 for (const server of servers) { 78 for (const server of servers) {
79 const { data } = await server.videosCommand.list() 79 const { data } = await server.videos.list()
80 80
81 let infoHashes: { [id: number]: string } 81 let infoHashes: { [id: number]: string }
82 82
83 for (const video of data) { 83 for (const video of data) {
84 const videoDetail = await server.videosCommand.get({ id: video.uuid }) 84 const videoDetail = await server.videos.get({ id: video.uuid })
85 85
86 if (video.uuid === videosUUID[1]) { 86 if (video.uuid === videosUUID[1]) {
87 expect(videoDetail.files).to.have.lengthOf(4) 87 expect(videoDetail.files).to.have.lengthOf(4)
@@ -110,15 +110,15 @@ describe('Test create transcoding jobs', function () {
110 it('Should run a transcoding job on video 1 with resolution', async function () { 110 it('Should run a transcoding job on video 1 with resolution', async function () {
111 this.timeout(60000) 111 this.timeout(60000)
112 112
113 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`) 113 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`)
114 114
115 await waitJobs(servers) 115 await waitJobs(servers)
116 116
117 for (const server of servers) { 117 for (const server of servers) {
118 const { data } = await server.videosCommand.list() 118 const { data } = await server.videos.list()
119 expect(data).to.have.lengthOf(videosUUID.length) 119 expect(data).to.have.lengthOf(videosUUID.length)
120 120
121 const videoDetails = await server.videosCommand.get({ id: videosUUID[0] }) 121 const videoDetails = await server.videos.get({ id: videosUUID[0] })
122 122
123 expect(videoDetails.files).to.have.lengthOf(2) 123 expect(videoDetails.files).to.have.lengthOf(2)
124 expect(videoDetails.files[0].resolution.id).to.equal(720) 124 expect(videoDetails.files[0].resolution.id).to.equal(720)
@@ -131,12 +131,12 @@ describe('Test create transcoding jobs', function () {
131 it('Should generate an HLS resolution', async function () { 131 it('Should generate an HLS resolution', async function () {
132 this.timeout(120000) 132 this.timeout(120000)
133 133
134 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) 134 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
135 135
136 await waitJobs(servers) 136 await waitJobs(servers)
137 137
138 for (const server of servers) { 138 for (const server of servers) {
139 const videoDetails = await server.videosCommand.get({ id: videosUUID[2] }) 139 const videoDetails = await server.videos.get({ id: videosUUID[2] })
140 140
141 expect(videoDetails.files).to.have.lengthOf(1) 141 expect(videoDetails.files).to.have.lengthOf(1)
142 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) 142 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
@@ -150,12 +150,12 @@ describe('Test create transcoding jobs', function () {
150 it('Should not duplicate an HLS resolution', async function () { 150 it('Should not duplicate an HLS resolution', async function () {
151 this.timeout(120000) 151 this.timeout(120000)
152 152
153 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) 153 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
154 154
155 await waitJobs(servers) 155 await waitJobs(servers)
156 156
157 for (const server of servers) { 157 for (const server of servers) {
158 const videoDetails = await server.videosCommand.get({ id: videosUUID[2] }) 158 const videoDetails = await server.videos.get({ id: videosUUID[2] })
159 159
160 const files = videoDetails.streamingPlaylists[0].files 160 const files = videoDetails.streamingPlaylists[0].files
161 expect(files).to.have.lengthOf(1) 161 expect(files).to.have.lengthOf(1)
@@ -166,12 +166,12 @@ describe('Test create transcoding jobs', function () {
166 it('Should generate all HLS resolutions', async function () { 166 it('Should generate all HLS resolutions', async function () {
167 this.timeout(120000) 167 this.timeout(120000)
168 168
169 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`) 169 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`)
170 170
171 await waitJobs(servers) 171 await waitJobs(servers)
172 172
173 for (const server of servers) { 173 for (const server of servers) {
174 const videoDetails = await server.videosCommand.get({ id: videosUUID[3] }) 174 const videoDetails = await server.videos.get({ id: videosUUID[3] })
175 175
176 expect(videoDetails.files).to.have.lengthOf(1) 176 expect(videoDetails.files).to.have.lengthOf(1)
177 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) 177 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
@@ -185,14 +185,14 @@ describe('Test create transcoding jobs', function () {
185 this.timeout(120000) 185 this.timeout(120000)
186 186
187 config.transcoding.hls.enabled = true 187 config.transcoding.hls.enabled = true
188 await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) 188 await servers[0].config.updateCustomSubConfig({ newConfig: config })
189 189
190 await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`) 190 await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`)
191 191
192 await waitJobs(servers) 192 await waitJobs(servers)
193 193
194 for (const server of servers) { 194 for (const server of servers) {
195 const videoDetails = await server.videosCommand.get({ id: videosUUID[4] }) 195 const videoDetails = await server.videos.get({ id: videosUUID[4] })
196 196
197 expect(videoDetails.files).to.have.lengthOf(4) 197 expect(videoDetails.files).to.have.lengthOf(4)
198 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) 198 expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)