]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/object-storage/videos.ts
Increase test timeout
[github/Chocobozzz/PeerTube.git] / server / tests / api / object-storage / videos.ts
index 3958bd3d7aae2e8a2f53946cb6c1ecee9f77149f..e1ba47d00b3036438c45717a61905f930d9b2a19 100644 (file)
@@ -10,6 +10,7 @@ import {
   createMultipleServers,
   createSingleServer,
   doubleFollow,
+  expectLogDoesNotContain,
   expectStartWith,
   killallServers,
   makeRawRequest,
@@ -197,7 +198,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)
@@ -212,6 +213,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] })
@@ -235,8 +242,14 @@ function runTestSuite (options: {
     }
   })
 
+  it('Should not have downloaded files from object storage', async function () {
+    for (const server of servers) {
+      await expectLogDoesNotContain(server, 'from object storage')
+    }
+  })
+
   after(async function () {
-    mockObjectStorage.terminate()
+    await mockObjectStorage.terminate()
 
     await cleanupTests(servers)
   })
@@ -373,8 +386,8 @@ describe('Object storage for videos', function () {
       playlistBucket: 'mybucket',
       webtorrentBucket: 'mybucket',
 
-      playlistPrefix: 'streaming-playlists_',
-      webtorrentPrefix: 'webtorrent_',
+      playlistPrefix: 'streaming-playlists/',
+      webtorrentPrefix: 'webtorrent/',
 
       useMockBaseUrl: true
     })