]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/object-storage/videos.ts
Move uuid stuff in extra utils
[github/Chocobozzz/PeerTube.git] / server / tests / api / object-storage / videos.ts
index 6e639218169b57988ef83d925bcd9b4828b6c94e..498efcb17e11af885e777ce0962c503b16252c6f 100644 (file)
@@ -3,25 +3,22 @@
 import 'mocha'
 import * as chai from 'chai'
 import { merge } from 'lodash'
+import { checkTmpIsEmpty, expectLogDoesNotContain, expectStartWith, MockObjectStorage } from '@server/tests/shared'
+import { areObjectStorageTestsDisabled } from '@shared/core-utils'
+import { HttpStatusCode, VideoDetails } from '@shared/models'
 import {
-  areObjectStorageTestsDisabled,
-  checkTmpIsEmpty,
   cleanupTests,
   createMultipleServers,
   createSingleServer,
   doubleFollow,
-  expectLogDoesNotContain,
-  expectStartWith,
   killallServers,
   makeRawRequest,
-  MockObjectStorage,
   ObjectStorageCommand,
   PeerTubeServer,
   setAccessTokensToServers,
   waitJobs,
   webtorrentAdd
-} from '@shared/extra-utils'
-import { HttpStatusCode, VideoDetails } from '@shared/models'
+} from '@shared/server-commands'
 
 const expect = chai.expect
 
@@ -182,7 +179,7 @@ function runTestSuite (options: {
   })
 
   it('Should upload a video and move it to the object storage without transcoding', async function () {
-    this.timeout(20000)
+    this.timeout(40000)
 
     const { uuid } = await servers[0].videos.quickUpload({ name: 'video 1' })
     uuidsToDelete.push(uuid)
@@ -198,7 +195,7 @@ function runTestSuite (options: {
   })
 
   it('Should upload a video and move it to the object storage with transcoding', async function () {
-    this.timeout(40000)
+    this.timeout(120000)
 
     const { uuid } = await servers[1].videos.quickUpload({ name: 'video 2' })
     uuidsToDelete.push(uuid)
@@ -213,6 +210,12 @@ function runTestSuite (options: {
     }
   })
 
+  it('Should fetch correctly all the files', async function () {
+    for (const url of deletedUrls.concat(keptUrls)) {
+      await makeRawRequest(url, HttpStatusCode.OK_200)
+    }
+  })
+
   it('Should correctly delete the files', async function () {
     await servers[0].videos.remove({ id: uuidsToDelete[0] })
     await servers[1].videos.remove({ id: uuidsToDelete[1] })