diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:47:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch) | |
tree | eaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/cli/prune-storage.ts | |
parent | 89d241a79c262b9775c233b73cff080043ebb5e6 (diff) | |
download | PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip |
Use an object to represent a server
Diffstat (limited to 'server/tests/cli/prune-storage.ts')
-rw-r--r-- | server/tests/cli/prune-storage.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts index 9912a36e0..5bf86462b 100644 --- a/server/tests/cli/prune-storage.ts +++ b/server/tests/cli/prune-storage.ts | |||
@@ -10,10 +10,10 @@ import { | |||
10 | cleanupTests, | 10 | cleanupTests, |
11 | CLICommand, | 11 | CLICommand, |
12 | doubleFollow, | 12 | doubleFollow, |
13 | flushAndRunMultipleServers, | 13 | createMultipleServers, |
14 | killallServers, | 14 | killallServers, |
15 | makeGetRequest, | 15 | makeGetRequest, |
16 | ServerInfo, | 16 | PeerTubeServer, |
17 | setAccessTokensToServers, | 17 | setAccessTokensToServers, |
18 | setDefaultVideoChannel, | 18 | setDefaultVideoChannel, |
19 | wait, | 19 | wait, |
@@ -23,13 +23,13 @@ import { VideoPlaylistPrivacy } from '@shared/models' | |||
23 | 23 | ||
24 | const expect = chai.expect | 24 | const expect = chai.expect |
25 | 25 | ||
26 | async function countFiles (server: ServerInfo, directory: string) { | 26 | async function countFiles (server: PeerTubeServer, directory: string) { |
27 | const files = await readdir(server.servers.buildDirectory(directory)) | 27 | const files = await readdir(server.servers.buildDirectory(directory)) |
28 | 28 | ||
29 | return files.length | 29 | return files.length |
30 | } | 30 | } |
31 | 31 | ||
32 | async function assertNotExists (server: ServerInfo, directory: string, substring: string) { | 32 | async function assertNotExists (server: PeerTubeServer, directory: string, substring: string) { |
33 | const files = await readdir(server.servers.buildDirectory(directory)) | 33 | const files = await readdir(server.servers.buildDirectory(directory)) |
34 | 34 | ||
35 | for (const f of files) { | 35 | for (const f of files) { |
@@ -37,7 +37,7 @@ async function assertNotExists (server: ServerInfo, directory: string, substring | |||
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | async function assertCountAreOkay (servers: ServerInfo[]) { | 40 | async function assertCountAreOkay (servers: PeerTubeServer[]) { |
41 | for (const server of servers) { | 41 | for (const server of servers) { |
42 | const videosCount = await countFiles(server, 'videos') | 42 | const videosCount = await countFiles(server, 'videos') |
43 | expect(videosCount).to.equal(8) | 43 | expect(videosCount).to.equal(8) |
@@ -57,13 +57,13 @@ async function assertCountAreOkay (servers: ServerInfo[]) { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | describe('Test prune storage scripts', function () { | 59 | describe('Test prune storage scripts', function () { |
60 | let servers: ServerInfo[] | 60 | let servers: PeerTubeServer[] |
61 | const badNames: { [directory: string]: string[] } = {} | 61 | const badNames: { [directory: string]: string[] } = {} |
62 | 62 | ||
63 | before(async function () { | 63 | before(async function () { |
64 | this.timeout(120000) | 64 | this.timeout(120000) |
65 | 65 | ||
66 | servers = await flushAndRunMultipleServers(2, { transcoding: { enabled: true } }) | 66 | servers = await createMultipleServers(2, { transcoding: { enabled: true } }) |
67 | await setAccessTokensToServers(servers) | 67 | await setAccessTokensToServers(servers) |
68 | await setDefaultVideoChannel(servers) | 68 | await setDefaultVideoChannel(servers) |
69 | 69 | ||