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.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 5c9e023e1..a0af09de8 100644
--- a/server/tests/cli/prune-storage.ts
+++ b/server/tests/cli/prune-storage.ts
@@ -2,7 +2,10 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { waitJobs } from '../../../shared/extra-utils/server/jobs' 5import { createFile, readdir } from 'fs-extra'
6import { join } from 'path'
7import { buildUUID } from '@server/helpers/uuid'
8import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
6import { 9import {
7 buildServerDirectory, 10 buildServerDirectory,
8 cleanupTests, 11 cleanupTests,
@@ -21,11 +24,8 @@ import {
21 uploadVideo, 24 uploadVideo,
22 wait 25 wait
23} from '../../../shared/extra-utils' 26} from '../../../shared/extra-utils'
27import { waitJobs } from '../../../shared/extra-utils/server/jobs'
24import { Account, VideoPlaylistPrivacy } from '../../../shared/models' 28import { Account, VideoPlaylistPrivacy } from '../../../shared/models'
25import { createFile, readdir } from 'fs-extra'
26import { v4 as uuidv4 } from 'uuid'
27import { join } from 'path'
28import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
29 29
30const expect = chai.expect 30const expect = chai.expect
31 31
@@ -131,8 +131,8 @@ describe('Test prune storage scripts', function () {
131 { 131 {
132 const base = buildServerDirectory(servers[0], 'videos') 132 const base = buildServerDirectory(servers[0], 'videos')
133 133
134 const n1 = uuidv4() + '.mp4' 134 const n1 = buildUUID() + '.mp4'
135 const n2 = uuidv4() + '.webm' 135 const n2 = buildUUID() + '.webm'
136 136
137 await createFile(join(base, n1)) 137 await createFile(join(base, n1))
138 await createFile(join(base, n2)) 138 await createFile(join(base, n2))
@@ -143,8 +143,8 @@ describe('Test prune storage scripts', function () {
143 { 143 {
144 const base = buildServerDirectory(servers[0], 'torrents') 144 const base = buildServerDirectory(servers[0], 'torrents')
145 145
146 const n1 = uuidv4() + '-240.torrent' 146 const n1 = buildUUID() + '-240.torrent'
147 const n2 = uuidv4() + '-480.torrent' 147 const n2 = buildUUID() + '-480.torrent'
148 148
149 await createFile(join(base, n1)) 149 await createFile(join(base, n1))
150 await createFile(join(base, n2)) 150 await createFile(join(base, n2))
@@ -155,8 +155,8 @@ describe('Test prune storage scripts', function () {
155 { 155 {
156 const base = buildServerDirectory(servers[0], 'thumbnails') 156 const base = buildServerDirectory(servers[0], 'thumbnails')
157 157
158 const n1 = uuidv4() + '.jpg' 158 const n1 = buildUUID() + '.jpg'
159 const n2 = uuidv4() + '.jpg' 159 const n2 = buildUUID() + '.jpg'
160 160
161 await createFile(join(base, n1)) 161 await createFile(join(base, n1))
162 await createFile(join(base, n2)) 162 await createFile(join(base, n2))
@@ -167,8 +167,8 @@ describe('Test prune storage scripts', function () {
167 { 167 {
168 const base = buildServerDirectory(servers[0], 'previews') 168 const base = buildServerDirectory(servers[0], 'previews')
169 169
170 const n1 = uuidv4() + '.jpg' 170 const n1 = buildUUID() + '.jpg'
171 const n2 = uuidv4() + '.jpg' 171 const n2 = buildUUID() + '.jpg'
172 172
173 await createFile(join(base, n1)) 173 await createFile(join(base, n1))
174 await createFile(join(base, n2)) 174 await createFile(join(base, n2))
@@ -179,8 +179,8 @@ describe('Test prune storage scripts', function () {
179 { 179 {
180 const base = buildServerDirectory(servers[0], 'avatars') 180 const base = buildServerDirectory(servers[0], 'avatars')
181 181
182 const n1 = uuidv4() + '.png' 182 const n1 = buildUUID() + '.png'
183 const n2 = uuidv4() + '.jpg' 183 const n2 = buildUUID() + '.jpg'
184 184
185 await createFile(join(base, n1)) 185 await createFile(join(base, n1))
186 await createFile(join(base, n2)) 186 await createFile(join(base, n2))