aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/cli')
-rw-r--r--server/tests/cli/prune-storage.ts29
-rw-r--r--server/tests/cli/update-host.ts3
2 files changed, 19 insertions, 13 deletions
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts
index a723ed8b4..3ca7c19ea 100644
--- a/server/tests/cli/prune-storage.ts
+++ b/server/tests/cli/prune-storage.ts
@@ -51,7 +51,7 @@ async function assertCountAreOkay (servers: PeerTubeServer[]) {
51 expect(thumbnailsCount).to.equal(6) 51 expect(thumbnailsCount).to.equal(6)
52 52
53 const avatarsCount = await countFiles(server, 'avatars') 53 const avatarsCount = await countFiles(server, 'avatars')
54 expect(avatarsCount).to.equal(2) 54 expect(avatarsCount).to.equal(4)
55 55
56 const hlsRootCount = await countFiles(server, 'streaming-playlists/hls') 56 const hlsRootCount = await countFiles(server, 'streaming-playlists/hls')
57 expect(hlsRootCount).to.equal(2) 57 expect(hlsRootCount).to.equal(2)
@@ -87,23 +87,28 @@ describe('Test prune storage scripts', function () {
87 87
88 await doubleFollow(servers[0], servers[1]) 88 await doubleFollow(servers[0], servers[1])
89 89
90 // Lazy load the remote avatar 90 // Lazy load the remote avatars
91 { 91 {
92 const account = await servers[0].accounts.get({ accountName: 'root@localhost:' + servers[1].port }) 92 const account = await servers[0].accounts.get({ accountName: 'root@localhost:' + servers[1].port })
93 await makeGetRequest({ 93
94 url: servers[0].url, 94 for (const avatar of account.avatars) {
95 path: account.avatar.path, 95 await makeGetRequest({
96 expectedStatus: HttpStatusCode.OK_200 96 url: servers[0].url,
97 }) 97 path: avatar.path,
98 expectedStatus: HttpStatusCode.OK_200
99 })
100 }
98 } 101 }
99 102
100 { 103 {
101 const account = await servers[1].accounts.get({ accountName: 'root@localhost:' + servers[0].port }) 104 const account = await servers[1].accounts.get({ accountName: 'root@localhost:' + servers[0].port })
102 await makeGetRequest({ 105 for (const avatar of account.avatars) {
103 url: servers[1].url, 106 await makeGetRequest({
104 path: account.avatar.path, 107 url: servers[1].url,
105 expectedStatus: HttpStatusCode.OK_200 108 path: avatar.path,
106 }) 109 expectedStatus: HttpStatusCode.OK_200
110 })
111 }
107 } 112 }
108 113
109 await wait(1000) 114 await wait(1000)
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts
index da89ff153..7c49efd20 100644
--- a/server/tests/cli/update-host.ts
+++ b/server/tests/cli/update-host.ts
@@ -12,6 +12,7 @@ import {
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 waitJobs 13 waitJobs
14} from '@shared/server-commands' 14} from '@shared/server-commands'
15import { getAllFiles } from '../shared'
15 16
16describe('Test update host scripts', function () { 17describe('Test update host scripts', function () {
17 let server: PeerTubeServer 18 let server: PeerTubeServer
@@ -108,7 +109,7 @@ describe('Test update host scripts', function () {
108 109
109 for (const video of data) { 110 for (const video of data) {
110 const videoDetails = await server.videos.get({ id: video.id }) 111 const videoDetails = await server.videos.get({ id: video.id })
111 const files = videoDetails.files.concat(videoDetails.streamingPlaylists[0].files) 112 const files = getAllFiles(videoDetails)
112 113
113 expect(files).to.have.lengthOf(8) 114 expect(files).to.have.lengthOf(8)
114 115