aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-28 16:06:49 +0200
committerChocobozzz <me@florianbigard.com>2023-07-28 16:06:49 +0200
commit74c8d5bf2d807870ed351fb2a0ee7137987aa995 (patch)
treedc4493ac1afe6b9033753741997318befa828940 /server/tests/api
parente390107e5acffda6b6fa994be1f2874183bab40c (diff)
downloadPeerTube-74c8d5bf2d807870ed351fb2a0ee7137987aa995.tar.gz
PeerTube-74c8d5bf2d807870ed351fb2a0ee7137987aa995.tar.zst
PeerTube-74c8d5bf2d807870ed351fb2a0ee7137987aa995.zip
Refactor enableTranscoding command helpers
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/runners.ts4
-rw-r--r--server/tests/api/check-params/video-files.ts6
-rw-r--r--server/tests/api/live/live-fast-restream.ts2
-rw-r--r--server/tests/api/runners/runner-common.ts2
-rw-r--r--server/tests/api/runners/runner-socket.ts2
-rw-r--r--server/tests/api/runners/runner-studio-transcoding.ts2
-rw-r--r--server/tests/api/runners/runner-vod-transcoding.ts10
-rw-r--r--server/tests/api/videos/video-files.ts2
-rw-r--r--server/tests/api/videos/video-source.ts4
-rw-r--r--server/tests/api/videos/videos-common-filters.ts6
10 files changed, 20 insertions, 20 deletions
diff --git a/server/tests/api/check-params/runners.ts b/server/tests/api/check-params/runners.ts
index 7f9a0cd32..0e5012da5 100644
--- a/server/tests/api/check-params/runners.ts
+++ b/server/tests/api/check-params/runners.ts
@@ -65,7 +65,7 @@ describe('Test managing runners', function () {
65 registrationToken = data[0].registrationToken 65 registrationToken = data[0].registrationToken
66 registrationTokenId = data[0].id 66 registrationTokenId = data[0].id
67 67
68 await server.config.enableTranscoding(true, true) 68 await server.config.enableTranscoding({ hls: true, webVideo: true })
69 await server.config.enableStudio() 69 await server.config.enableStudio()
70 await server.config.enableRemoteTranscoding() 70 await server.config.enableRemoteTranscoding()
71 await server.config.enableRemoteStudio() 71 await server.config.enableRemoteStudio()
@@ -451,7 +451,7 @@ describe('Test managing runners', function () {
451 const { uuid } = await server.videos.quickUpload({ name: 'video studio' }) 451 const { uuid } = await server.videos.quickUpload({ name: 'video studio' })
452 videoStudioUUID = uuid 452 videoStudioUUID = uuid
453 453
454 await server.config.enableTranscoding(true, true) 454 await server.config.enableTranscoding({ hls: true, webVideo: true })
455 await server.config.enableStudio() 455 await server.config.enableStudio()
456 456
457 await server.videoStudio.createEditionTasks({ 457 await server.videoStudio.createEditionTasks({
diff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.ts
index 4d43ab6f8..01d6a912b 100644
--- a/server/tests/api/check-params/video-files.ts
+++ b/server/tests/api/check-params/video-files.ts
@@ -87,7 +87,7 @@ describe('Test videos files', function () {
87 } 87 }
88 88
89 { 89 {
90 await servers[0].config.enableTranscoding(true, true) 90 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
91 91
92 { 92 {
93 const { uuid } = await servers[0].videos.quickUpload({ name: 'both 1' }) 93 const { uuid } = await servers[0].videos.quickUpload({ name: 'both 1' })
@@ -108,7 +108,7 @@ describe('Test videos files', function () {
108 await waitJobs(servers) 108 await waitJobs(servers)
109 109
110 { 110 {
111 await servers[0].config.enableTranscoding(false, true) 111 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
112 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls' }) 112 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls' })
113 hlsId = uuid 113 hlsId = uuid
114 } 114 }
@@ -116,7 +116,7 @@ describe('Test videos files', function () {
116 await waitJobs(servers) 116 await waitJobs(servers)
117 117
118 { 118 {
119 await servers[0].config.enableTranscoding(false, true) 119 await servers[0].config.enableTranscoding({ webVideo: true, hls: false })
120 const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) 120 const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' })
121 webVideoId = uuid 121 webVideoId = uuid
122 } 122 }
diff --git a/server/tests/api/live/live-fast-restream.ts b/server/tests/api/live/live-fast-restream.ts
index d7085a957..1b7fddd8b 100644
--- a/server/tests/api/live/live-fast-restream.ts
+++ b/server/tests/api/live/live-fast-restream.ts
@@ -133,7 +133,7 @@ describe('Fast restream in live', function () {
133 await setAccessTokensToServers([ server ]) 133 await setAccessTokensToServers([ server ])
134 await setDefaultVideoChannel([ server ]) 134 await setDefaultVideoChannel([ server ])
135 135
136 await server.config.enableMinimumTranscoding(false, true) 136 await server.config.enableMinimumTranscoding({ webVideo: false, hls: true })
137 await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' }) 137 await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' })
138 }) 138 })
139 139
diff --git a/server/tests/api/runners/runner-common.ts b/server/tests/api/runners/runner-common.ts
index 7fed75f40..9b2eb8b27 100644
--- a/server/tests/api/runners/runner-common.ts
+++ b/server/tests/api/runners/runner-common.ts
@@ -40,7 +40,7 @@ describe('Test runner common actions', function () {
40 await setAccessTokensToServers([ server ]) 40 await setAccessTokensToServers([ server ])
41 await setDefaultVideoChannel([ server ]) 41 await setDefaultVideoChannel([ server ])
42 42
43 await server.config.enableTranscoding(true, true) 43 await server.config.enableTranscoding({ hls: true, webVideo: true })
44 await server.config.enableRemoteTranscoding() 44 await server.config.enableRemoteTranscoding()
45 }) 45 })
46 46
diff --git a/server/tests/api/runners/runner-socket.ts b/server/tests/api/runners/runner-socket.ts
index a77e57a11..215164e48 100644
--- a/server/tests/api/runners/runner-socket.ts
+++ b/server/tests/api/runners/runner-socket.ts
@@ -23,7 +23,7 @@ describe('Test runner socket', function () {
23 await setAccessTokensToServers([ server ]) 23 await setAccessTokensToServers([ server ])
24 await setDefaultVideoChannel([ server ]) 24 await setDefaultVideoChannel([ server ])
25 25
26 await server.config.enableTranscoding(true, true) 26 await server.config.enableTranscoding({ hls: true, webVideo: true })
27 await server.config.enableRemoteTranscoding() 27 await server.config.enableRemoteTranscoding()
28 runnerToken = await server.runners.autoRegisterRunner() 28 runnerToken = await server.runners.autoRegisterRunner()
29 }) 29 })
diff --git a/server/tests/api/runners/runner-studio-transcoding.ts b/server/tests/api/runners/runner-studio-transcoding.ts
index 443a9d02a..f5cea6cea 100644
--- a/server/tests/api/runners/runner-studio-transcoding.ts
+++ b/server/tests/api/runners/runner-studio-transcoding.ts
@@ -53,7 +53,7 @@ describe('Test runner video studio transcoding', function () {
53 53
54 await doubleFollow(servers[0], servers[1]) 54 await doubleFollow(servers[0], servers[1])
55 55
56 await servers[0].config.enableTranscoding(true, true) 56 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
57 await servers[0].config.enableStudio() 57 await servers[0].config.enableStudio()
58 await servers[0].config.enableRemoteStudio() 58 await servers[0].config.enableRemoteStudio()
59 59
diff --git a/server/tests/api/runners/runner-vod-transcoding.ts b/server/tests/api/runners/runner-vod-transcoding.ts
index ca16d9c10..ee6be4ee9 100644
--- a/server/tests/api/runners/runner-vod-transcoding.ts
+++ b/server/tests/api/runners/runner-vod-transcoding.ts
@@ -85,7 +85,7 @@ describe('Test runner VOD transcoding', function () {
85 before(async function () { 85 before(async function () {
86 this.timeout(60000) 86 this.timeout(60000)
87 87
88 await servers[0].config.enableTranscoding(true, true) 88 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
89 }) 89 })
90 90
91 it('Should error a transcoding job', async function () { 91 it('Should error a transcoding job', async function () {
@@ -133,7 +133,7 @@ describe('Test runner VOD transcoding', function () {
133 this.timeout(60000) 133 this.timeout(60000)
134 134
135 await servers[0].runnerJobs.cancelAllJobs() 135 await servers[0].runnerJobs.cancelAllJobs()
136 await servers[0].config.enableTranscoding(true, false) 136 await servers[0].config.enableTranscoding({ hls: false, webVideo: true })
137 137
138 const { uuid } = await servers[0].videos.quickUpload({ name: 'web video', fixture: 'video_short.webm' }) 138 const { uuid } = await servers[0].videos.quickUpload({ name: 'web video', fixture: 'video_short.webm' })
139 videoUUID = uuid 139 videoUUID = uuid
@@ -264,7 +264,7 @@ describe('Test runner VOD transcoding', function () {
264 before(async function () { 264 before(async function () {
265 this.timeout(60000) 265 this.timeout(60000)
266 266
267 await servers[0].config.enableTranscoding(false, true) 267 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
268 268
269 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls video', fixture: 'video_short.webm' }) 269 const { uuid } = await servers[0].videos.quickUpload({ name: 'hls video', fixture: 'video_short.webm' })
270 videoUUID = uuid 270 videoUUID = uuid
@@ -384,7 +384,7 @@ describe('Test runner VOD transcoding', function () {
384 before(async function () { 384 before(async function () {
385 this.timeout(60000) 385 this.timeout(60000)
386 386
387 await servers[0].config.enableTranscoding(true, true) 387 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
388 388
389 await servers[0].videos.quickUpload({ name: 'web video and hls video', fixture: 'video_short.webm' }) 389 await servers[0].videos.quickUpload({ name: 'web video and hls video', fixture: 'video_short.webm' })
390 390
@@ -422,7 +422,7 @@ describe('Test runner VOD transcoding', function () {
422 before(async function () { 422 before(async function () {
423 this.timeout(60000) 423 this.timeout(60000)
424 424
425 await servers[0].config.enableTranscoding(true, true) 425 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
426 426
427 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' } 427 const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' }
428 const { uuid } = await servers[0].videos.upload({ attributes, mode: 'legacy' }) 428 const { uuid } = await servers[0].videos.upload({ attributes, mode: 'legacy' })
diff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.ts
index 0a183c44d..4f75cd106 100644
--- a/server/tests/api/videos/video-files.ts
+++ b/server/tests/api/videos/video-files.ts
@@ -25,7 +25,7 @@ describe('Test videos files', function () {
25 25
26 await doubleFollow(servers[0], servers[1]) 26 await doubleFollow(servers[0], servers[1])
27 27
28 await servers[0].config.enableTranscoding(true, true) 28 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
29 }) 29 })
30 30
31 describe('When deleting all files', function () { 31 describe('When deleting all files', function () {
diff --git a/server/tests/api/videos/video-source.ts b/server/tests/api/videos/video-source.ts
index 8669f342e..1f394f904 100644
--- a/server/tests/api/videos/video-source.ts
+++ b/server/tests/api/videos/video-source.ts
@@ -114,7 +114,7 @@ describe('Test a video file replacement', function () {
114 114
115 const previousPaths: string[] = [] 115 const previousPaths: string[] = []
116 116
117 await servers[0].config.enableTranscoding(true, true, true) 117 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
118 118
119 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'fs with transcoding', fixture: 'video_short_720p.mp4' }) 119 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'fs with transcoding', fixture: 'video_short_720p.mp4' })
120 uuid = videoUUID 120 uuid = videoUUID
@@ -387,7 +387,7 @@ describe('Test a video file replacement', function () {
387 387
388 const previousPaths: string[] = [] 388 const previousPaths: string[] = []
389 389
390 await servers[0].config.enableTranscoding(true, true, true) 390 await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true })
391 391
392 const { uuid: videoUUID } = await servers[0].videos.quickUpload({ 392 const { uuid: videoUUID } = await servers[0].videos.quickUpload({
393 name: 'object storage with transcoding', 393 name: 'object storage with transcoding',
diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts
index ba861164b..f68560b06 100644
--- a/server/tests/api/videos/videos-common-filters.ts
+++ b/server/tests/api/videos/videos-common-filters.ts
@@ -468,19 +468,19 @@ describe('Test videos filter', function () {
468 468
469 const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name) 469 const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name)
470 470
471 await servers[0].config.enableTranscoding(true, false) 471 await servers[0].config.enableTranscoding({ hls: false, webVideo: true })
472 await servers[0].videos.upload({ attributes: { name: 'web video' } }) 472 await servers[0].videos.upload({ attributes: { name: 'web video' } })
473 const hasWebVideo = finderFactory('web video') 473 const hasWebVideo = finderFactory('web video')
474 474
475 await waitJobs(servers) 475 await waitJobs(servers)
476 476
477 await servers[0].config.enableTranscoding(false, true) 477 await servers[0].config.enableTranscoding({ hls: true, webVideo: false })
478 await servers[0].videos.upload({ attributes: { name: 'hls video' } }) 478 await servers[0].videos.upload({ attributes: { name: 'hls video' } })
479 const hasHLS = finderFactory('hls video') 479 const hasHLS = finderFactory('hls video')
480 480
481 await waitJobs(servers) 481 await waitJobs(servers)
482 482
483 await servers[0].config.enableTranscoding(true, true) 483 await servers[0].config.enableTranscoding({ hls: true, webVideo: true })
484 await servers[0].videos.upload({ attributes: { name: 'hls and web video' } }) 484 await servers[0].videos.upload({ attributes: { name: 'hls and web video' } })
485 const hasBoth = finderFactory('hls and web video') 485 const hasBoth = finderFactory('hls and web video')
486 486