aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/prune-storage.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/cli/prune-storage.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/cli/prune-storage.ts')
-rw-r--r--server/tests/cli/prune-storage.ts30
1 files changed, 15 insertions, 15 deletions
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts
index a4556312b..9912a36e0 100644
--- a/server/tests/cli/prune-storage.ts
+++ b/server/tests/cli/prune-storage.ts
@@ -24,13 +24,13 @@ import { VideoPlaylistPrivacy } from '@shared/models'
24const expect = chai.expect 24const expect = chai.expect
25 25
26async function countFiles (server: ServerInfo, directory: string) { 26async function countFiles (server: ServerInfo, directory: string) {
27 const files = await readdir(server.serversCommand.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
32async function assertNotExists (server: ServerInfo, directory: string, substring: string) { 32async function assertNotExists (server: ServerInfo, directory: string, substring: string) {
33 const files = await readdir(server.serversCommand.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) {
36 expect(f).to.not.contain(substring) 36 expect(f).to.not.contain(substring)
@@ -68,16 +68,16 @@ describe('Test prune storage scripts', function () {
68 await setDefaultVideoChannel(servers) 68 await setDefaultVideoChannel(servers)
69 69
70 for (const server of servers) { 70 for (const server of servers) {
71 await server.videosCommand.upload({ attributes: { name: 'video 1' } }) 71 await server.videos.upload({ attributes: { name: 'video 1' } })
72 await server.videosCommand.upload({ attributes: { name: 'video 2' } }) 72 await server.videos.upload({ attributes: { name: 'video 2' } })
73 73
74 await server.usersCommand.updateMyAvatar({ fixture: 'avatar.png' }) 74 await server.users.updateMyAvatar({ fixture: 'avatar.png' })
75 75
76 await server.playlistsCommand.create({ 76 await server.playlists.create({
77 attributes: { 77 attributes: {
78 displayName: 'playlist', 78 displayName: 'playlist',
79 privacy: VideoPlaylistPrivacy.PUBLIC, 79 privacy: VideoPlaylistPrivacy.PUBLIC,
80 videoChannelId: server.videoChannel.id, 80 videoChannelId: server.store.channel.id,
81 thumbnailfile: 'thumbnail.jpg' 81 thumbnailfile: 'thumbnail.jpg'
82 } 82 }
83 }) 83 })
@@ -87,7 +87,7 @@ describe('Test prune storage scripts', function () {
87 87
88 // Lazy load the remote avatar 88 // Lazy load the remote avatar
89 { 89 {
90 const account = await servers[0].accountsCommand.get({ accountName: 'root@localhost:' + servers[1].port }) 90 const account = await servers[0].accounts.get({ accountName: 'root@localhost:' + servers[1].port })
91 await makeGetRequest({ 91 await makeGetRequest({
92 url: servers[0].url, 92 url: servers[0].url,
93 path: account.avatar.path, 93 path: account.avatar.path,
@@ -96,7 +96,7 @@ describe('Test prune storage scripts', function () {
96 } 96 }
97 97
98 { 98 {
99 const account = await servers[1].accountsCommand.get({ accountName: 'root@localhost:' + servers[0].port }) 99 const account = await servers[1].accounts.get({ accountName: 'root@localhost:' + servers[0].port })
100 await makeGetRequest({ 100 await makeGetRequest({
101 url: servers[1].url, 101 url: servers[1].url,
102 path: account.avatar.path, 102 path: account.avatar.path,
@@ -119,7 +119,7 @@ describe('Test prune storage scripts', function () {
119 it('Should create some dirty files', async function () { 119 it('Should create some dirty files', async function () {
120 for (let i = 0; i < 2; i++) { 120 for (let i = 0; i < 2; i++) {
121 { 121 {
122 const base = servers[0].serversCommand.buildDirectory('videos') 122 const base = servers[0].servers.buildDirectory('videos')
123 123
124 const n1 = buildUUID() + '.mp4' 124 const n1 = buildUUID() + '.mp4'
125 const n2 = buildUUID() + '.webm' 125 const n2 = buildUUID() + '.webm'
@@ -131,7 +131,7 @@ describe('Test prune storage scripts', function () {
131 } 131 }
132 132
133 { 133 {
134 const base = servers[0].serversCommand.buildDirectory('torrents') 134 const base = servers[0].servers.buildDirectory('torrents')
135 135
136 const n1 = buildUUID() + '-240.torrent' 136 const n1 = buildUUID() + '-240.torrent'
137 const n2 = buildUUID() + '-480.torrent' 137 const n2 = buildUUID() + '-480.torrent'
@@ -143,7 +143,7 @@ describe('Test prune storage scripts', function () {
143 } 143 }
144 144
145 { 145 {
146 const base = servers[0].serversCommand.buildDirectory('thumbnails') 146 const base = servers[0].servers.buildDirectory('thumbnails')
147 147
148 const n1 = buildUUID() + '.jpg' 148 const n1 = buildUUID() + '.jpg'
149 const n2 = buildUUID() + '.jpg' 149 const n2 = buildUUID() + '.jpg'
@@ -155,7 +155,7 @@ describe('Test prune storage scripts', function () {
155 } 155 }
156 156
157 { 157 {
158 const base = servers[0].serversCommand.buildDirectory('previews') 158 const base = servers[0].servers.buildDirectory('previews')
159 159
160 const n1 = buildUUID() + '.jpg' 160 const n1 = buildUUID() + '.jpg'
161 const n2 = buildUUID() + '.jpg' 161 const n2 = buildUUID() + '.jpg'
@@ -167,7 +167,7 @@ describe('Test prune storage scripts', function () {
167 } 167 }
168 168
169 { 169 {
170 const base = servers[0].serversCommand.buildDirectory('avatars') 170 const base = servers[0].servers.buildDirectory('avatars')
171 171
172 const n1 = buildUUID() + '.png' 172 const n1 = buildUUID() + '.png'
173 const n2 = buildUUID() + '.jpg' 173 const n2 = buildUUID() + '.jpg'
@@ -183,7 +183,7 @@ describe('Test prune storage scripts', function () {
183 it('Should run prune storage', async function () { 183 it('Should run prune storage', async function () {
184 this.timeout(30000) 184 this.timeout(30000)
185 185
186 const env = servers[0].cliCommand.getEnv() 186 const env = servers[0].cli.getEnv()
187 await CLICommand.exec(`echo y | ${env} npm run prune-storage`) 187 await CLICommand.exec(`echo y | ${env} npm run prune-storage`)
188 }) 188 })
189 189