aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/benchmark.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts
index 272f9e8b1..d9e4a08ab 100644
--- a/scripts/benchmark.ts
+++ b/scripts/benchmark.ts
@@ -1,6 +1,6 @@
1import * as autocannon from 'autocannon' 1import * as autocannon from 'autocannon'
2import { writeJson } from 'fs-extra' 2import { writeJson } from 'fs-extra'
3import { flushAndRunServer, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '@shared/extra-utils' 3import { flushAndRunServer, killallServers, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils'
4import { Video, VideoPrivacy } from '@shared/models' 4import { Video, VideoPrivacy } from '@shared/models'
5import { registerTSPaths } from '../server/helpers/register-ts-paths' 5import { registerTSPaths } from '../server/helpers/register-ts-paths'
6 6
@@ -197,7 +197,7 @@ async function prepare () {
197 }) 197 })
198 await setAccessTokensToServers([ server ]) 198 await setAccessTokensToServers([ server ])
199 199
200 const videoAttributes = { 200 const attributes = {
201 name: 'my super video', 201 name: 'my super video',
202 category: 2, 202 category: 2,
203 nsfw: true, 203 nsfw: true,
@@ -210,12 +210,11 @@ async function prepare () {
210 } 210 }
211 211
212 for (let i = 0; i < 10; i++) { 212 for (let i = 0; i < 10; i++) {
213 Object.assign(videoAttributes, { name: 'my super video ' + i }) 213 await server.videosCommand.upload({ attributes: { ...attributes, name: 'my super video ' + i } })
214 await uploadVideo(server.url, server.accessToken, videoAttributes)
215 } 214 }
216 215
217 const resVideos = await getVideosList(server.url) 216 const { data } = await server.videosCommand.list()
218 video = resVideos.body.data.find(v => v.name === 'my super video 1') 217 video = data.find(v => v.name === 'my super video 1')
219 218
220 for (let i = 0; i < 10; i++) { 219 for (let i = 0; i < 10; i++) {
221 const text = 'my super first comment' 220 const text = 'my super first comment'