X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Ftranscoding%2Fvideo-studio.ts;h=d1298caf7d06db6a70c4a731a88db26c1891cf7a;hb=f89189907bbdff6c4bc6d3460ed9ef4c49515f17;hp=2f64ef6bdb88c4f6019ff5012a61a99af563e625;hpb=5e47f6ab984a7d00782e4c7030afffa1ba480add;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.ts index 2f64ef6bd..d1298caf7 100644 --- a/server/tests/api/transcoding/video-studio.ts +++ b/server/tests/api/transcoding/video-studio.ts @@ -270,7 +270,7 @@ describe('Test video studio', function () { }) }) - describe('HLS only video edition', function () { + describe('HLS only studio edition', function () { before(async function () { // Disable webtorrent @@ -300,14 +300,39 @@ describe('Test video studio', function () { }) }) - describe('Object storage video edition', function () { + describe('Server restart', function () { + + it('Should still be able to run video edition after a server restart', async function () { + this.timeout(240_000) + + await renewVideo() + await servers[0].videoStudio.createEditionTasks({ videoId: videoUUID, tasks: VideoStudioCommand.getComplexTask() }) + + await servers[0].kill() + await servers[0].run() + + await waitJobs(servers) + + for (const server of servers) { + await checkVideoDuration(server, videoUUID, 9) + } + }) + + it('Should have an empty persistent tmp directory', async function () { + await checkPersistentTmpIsEmpty(servers[0]) + }) + }) + + describe('Object storage studio edition', function () { if (areMockObjectStorageTestsDisabled()) return + const objectStorage = new ObjectStorageCommand() + before(async function () { - await ObjectStorageCommand.prepareDefaultMockBuckets() + await objectStorage.prepareDefaultMockBuckets() await servers[0].kill() - await servers[0].run(ObjectStorageCommand.getDefaultMockConfig()) + await servers[0].run(objectStorage.getDefaultMockConfig()) await servers[0].config.enableMinimumTranscoding() }) @@ -330,38 +355,19 @@ describe('Test video studio', function () { } for (const webtorrentFile of video.files) { - expectStartWith(webtorrentFile.fileUrl, ObjectStorageCommand.getMockWebTorrentBaseUrl()) + expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) } for (const hlsFile of video.streamingPlaylists[0].files) { - expectStartWith(hlsFile.fileUrl, ObjectStorageCommand.getMockPlaylistBaseUrl()) + expectStartWith(hlsFile.fileUrl, objectStorage.getMockPlaylistBaseUrl()) } await checkVideoDuration(server, videoUUID, 9) } }) - }) - - describe('Server restart', function () { - - it('Should still be able to run video edition after a server restart', async function () { - this.timeout(240_000) - - await renewVideo() - await servers[0].videoStudio.createEditionTasks({ videoId: videoUUID, tasks: VideoStudioCommand.getComplexTask() }) - - await servers[0].kill() - await servers[0].run() - - await waitJobs(servers) - - for (const server of servers) { - await checkVideoDuration(server, videoUUID, 9) - } - }) - it('Should have an empty persistent tmp directory', async function () { - await checkPersistentTmpIsEmpty(servers[0]) + after(async function () { + await objectStorage.cleanupMock() }) })