diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/server/servers.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index 5e1de6ece..6ab7bee90 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts | |||
@@ -7,6 +7,7 @@ import { join } from 'path' | |||
7 | import { randomInt } from '../../core-utils/miscs/miscs' | 7 | import { randomInt } from '../../core-utils/miscs/miscs' |
8 | import { VideoChannel } from '../../models/videos' | 8 | import { VideoChannel } from '../../models/videos' |
9 | import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs' | 9 | import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs' |
10 | import { makeGetRequest } from '../requests/requests' | ||
10 | 11 | ||
11 | interface ServerInfo { | 12 | interface ServerInfo { |
12 | app: ChildProcess | 13 | app: ChildProcess |
@@ -347,6 +348,14 @@ async function getServerFileSize (server: ServerInfo, subPath: string) { | |||
347 | return getFileSize(path) | 348 | return getFileSize(path) |
348 | } | 349 | } |
349 | 350 | ||
351 | function makePingRequest (server: ServerInfo) { | ||
352 | return makeGetRequest({ | ||
353 | url: server.url, | ||
354 | path: '/api/v1/ping', | ||
355 | statusCodeExpected: 200 | ||
356 | }) | ||
357 | } | ||
358 | |||
350 | // --------------------------------------------------------------------------- | 359 | // --------------------------------------------------------------------------- |
351 | 360 | ||
352 | export { | 361 | export { |
@@ -358,6 +367,7 @@ export { | |||
358 | cleanupTests, | 367 | cleanupTests, |
359 | flushAndRunMultipleServers, | 368 | flushAndRunMultipleServers, |
360 | flushTests, | 369 | flushTests, |
370 | makePingRequest, | ||
361 | flushAndRunServer, | 371 | flushAndRunServer, |
362 | killallServers, | 372 | killallServers, |
363 | reRunServer, | 373 | reRunServer, |