From 74c8d5bf2d807870ed351fb2a0ee7137987aa995 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Jul 2023 16:06:49 +0200 Subject: Refactor enableTranscoding command helpers --- server/tests/api/check-params/runners.ts | 4 ++-- server/tests/api/check-params/video-files.ts | 6 +++--- server/tests/api/live/live-fast-restream.ts | 2 +- server/tests/api/runners/runner-common.ts | 2 +- server/tests/api/runners/runner-socket.ts | 2 +- server/tests/api/runners/runner-studio-transcoding.ts | 2 +- server/tests/api/runners/runner-vod-transcoding.ts | 10 +++++----- server/tests/api/videos/video-files.ts | 2 +- server/tests/api/videos/video-source.ts | 4 ++-- server/tests/api/videos/videos-common-filters.ts | 6 +++--- 10 files changed, 20 insertions(+), 20 deletions(-) (limited to 'server/tests/api') 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 () { registrationToken = data[0].registrationToken registrationTokenId = data[0].id - await server.config.enableTranscoding(true, true) + await server.config.enableTranscoding({ hls: true, webVideo: true }) await server.config.enableStudio() await server.config.enableRemoteTranscoding() await server.config.enableRemoteStudio() @@ -451,7 +451,7 @@ describe('Test managing runners', function () { const { uuid } = await server.videos.quickUpload({ name: 'video studio' }) videoStudioUUID = uuid - await server.config.enableTranscoding(true, true) + await server.config.enableTranscoding({ hls: true, webVideo: true }) await server.config.enableStudio() 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 () { } { - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) { const { uuid } = await servers[0].videos.quickUpload({ name: 'both 1' }) @@ -108,7 +108,7 @@ describe('Test videos files', function () { await waitJobs(servers) { - await servers[0].config.enableTranscoding(false, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: false }) const { uuid } = await servers[0].videos.quickUpload({ name: 'hls' }) hlsId = uuid } @@ -116,7 +116,7 @@ describe('Test videos files', function () { await waitJobs(servers) { - await servers[0].config.enableTranscoding(false, true) + await servers[0].config.enableTranscoding({ webVideo: true, hls: false }) const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) webVideoId = uuid } 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 () { await setAccessTokensToServers([ server ]) await setDefaultVideoChannel([ server ]) - await server.config.enableMinimumTranscoding(false, true) + await server.config.enableMinimumTranscoding({ webVideo: false, hls: true }) await server.config.enableLive({ allowReplay: true, transcoding: true, resolutions: 'min' }) }) 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 () { await setAccessTokensToServers([ server ]) await setDefaultVideoChannel([ server ]) - await server.config.enableTranscoding(true, true) + await server.config.enableTranscoding({ hls: true, webVideo: true }) await server.config.enableRemoteTranscoding() }) 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 () { await setAccessTokensToServers([ server ]) await setDefaultVideoChannel([ server ]) - await server.config.enableTranscoding(true, true) + await server.config.enableTranscoding({ hls: true, webVideo: true }) await server.config.enableRemoteTranscoding() runnerToken = await server.runners.autoRegisterRunner() }) 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 () { await doubleFollow(servers[0], servers[1]) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) await servers[0].config.enableStudio() await servers[0].config.enableRemoteStudio() 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 () { before(async function () { this.timeout(60000) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) }) it('Should error a transcoding job', async function () { @@ -133,7 +133,7 @@ describe('Test runner VOD transcoding', function () { this.timeout(60000) await servers[0].runnerJobs.cancelAllJobs() - await servers[0].config.enableTranscoding(true, false) + await servers[0].config.enableTranscoding({ hls: false, webVideo: true }) const { uuid } = await servers[0].videos.quickUpload({ name: 'web video', fixture: 'video_short.webm' }) videoUUID = uuid @@ -264,7 +264,7 @@ describe('Test runner VOD transcoding', function () { before(async function () { this.timeout(60000) - await servers[0].config.enableTranscoding(false, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: false }) const { uuid } = await servers[0].videos.quickUpload({ name: 'hls video', fixture: 'video_short.webm' }) videoUUID = uuid @@ -384,7 +384,7 @@ describe('Test runner VOD transcoding', function () { before(async function () { this.timeout(60000) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) await servers[0].videos.quickUpload({ name: 'web video and hls video', fixture: 'video_short.webm' }) @@ -422,7 +422,7 @@ describe('Test runner VOD transcoding', function () { before(async function () { this.timeout(60000) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) const attributes = { name: 'audio_with_preview', previewfile: 'custom-preview.jpg', fixture: 'sample.ogg' } 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 () { await doubleFollow(servers[0], servers[1]) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) }) 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 () { const previousPaths: string[] = [] - await servers[0].config.enableTranscoding(true, true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true }) const { uuid: videoUUID } = await servers[0].videos.quickUpload({ name: 'fs with transcoding', fixture: 'video_short_720p.mp4' }) uuid = videoUUID @@ -387,7 +387,7 @@ describe('Test a video file replacement', function () { const previousPaths: string[] = [] - await servers[0].config.enableTranscoding(true, true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true, with0p: true }) const { uuid: videoUUID } = await servers[0].videos.quickUpload({ 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 () { const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name) - await servers[0].config.enableTranscoding(true, false) + await servers[0].config.enableTranscoding({ hls: false, webVideo: true }) await servers[0].videos.upload({ attributes: { name: 'web video' } }) const hasWebVideo = finderFactory('web video') await waitJobs(servers) - await servers[0].config.enableTranscoding(false, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: false }) await servers[0].videos.upload({ attributes: { name: 'hls video' } }) const hasHLS = finderFactory('hls video') await waitJobs(servers) - await servers[0].config.enableTranscoding(true, true) + await servers[0].config.enableTranscoding({ hls: true, webVideo: true }) await servers[0].videos.upload({ attributes: { name: 'hls and web video' } }) const hasBoth = finderFactory('hls and web video') -- cgit v1.2.3