]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/prune-storage.ts
Remove unnecessary logs
[github/Chocobozzz/PeerTube.git] / server / tests / cli / prune-storage.ts
index 4b4f755271a6a0ae51660e869a51c84ca9c9901a..3ca7c19eaf596f4ede3a8c5bcb18dd918258b0a2 100644 (file)
@@ -4,7 +4,9 @@ import 'mocha'
 import * as chai from 'chai'
 import { createFile, readdir } from 'fs-extra'
 import { join } from 'path'
-import { buildUUID } from '@shared/core-utils/uuid'
+import { wait } from '@shared/core-utils'
+import { buildUUID } from '@shared/extra-utils'
+import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
 import {
   cleanupTests,
   CLICommand,
@@ -15,10 +17,8 @@ import {
   PeerTubeServer,
   setAccessTokensToServers,
   setDefaultVideoChannel,
-  wait,
   waitJobs
-} from '@shared/extra-utils'
-import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
+} from '@shared/server-commands'
 
 const expect = chai.expect
 
@@ -51,7 +51,7 @@ async function assertCountAreOkay (servers: PeerTubeServer[]) {
     expect(thumbnailsCount).to.equal(6)
 
     const avatarsCount = await countFiles(server, 'avatars')
-    expect(avatarsCount).to.equal(2)
+    expect(avatarsCount).to.equal(4)
 
     const hlsRootCount = await countFiles(server, 'streaming-playlists/hls')
     expect(hlsRootCount).to.equal(2)
@@ -87,23 +87,28 @@ describe('Test prune storage scripts', function () {
 
     await doubleFollow(servers[0], servers[1])
 
-    // Lazy load the remote avatar
+    // Lazy load the remote avatars
     {
       const account = await servers[0].accounts.get({ accountName: 'root@localhost:' + servers[1].port })
-      await makeGetRequest({
-        url: servers[0].url,
-        path: account.avatar.path,
-        expectedStatus: HttpStatusCode.OK_200
-      })
+
+      for (const avatar of account.avatars) {
+        await makeGetRequest({
+          url: servers[0].url,
+          path: avatar.path,
+          expectedStatus: HttpStatusCode.OK_200
+        })
+      }
     }
 
     {
       const account = await servers[1].accounts.get({ accountName: 'root@localhost:' + servers[0].port })
-      await makeGetRequest({
-        url: servers[1].url,
-        path: account.avatar.path,
-        expectedStatus: HttpStatusCode.OK_200
-      })
+      for (const avatar of account.avatars) {
+        await makeGetRequest({
+          url: servers[1].url,
+          path: avatar.path,
+          expectedStatus: HttpStatusCode.OK_200
+        })
+      }
     }
 
     await wait(1000)