]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/transcoding/video-studio.ts
Prevent object storage mock conflicts
[github/Chocobozzz/PeerTube.git] / server / tests / api / transcoding / video-studio.ts
index 2f64ef6bdb88c4f6019ff5012a61a99af563e625..d1298caf7d06db6a70c4a731a88db26c1891cf7a 100644 (file)
@@ -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()
     })
   })