diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-13 09:38:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-13 09:38:19 +0100 |
commit | 78d62f4d182be2f72f4901c38a0d10bb147896e8 (patch) | |
tree | d68b591387a526b235311fc5ec3a2d6f871a071b /shared/extra-utils/server | |
parent | 9bb720f3f96d781d5e132220ace4515e779cea3c (diff) | |
download | PeerTube-78d62f4d182be2f72f4901c38a0d10bb147896e8.tar.gz PeerTube-78d62f4d182be2f72f4901c38a0d10bb147896e8.tar.zst PeerTube-78d62f4d182be2f72f4901c38a0d10bb147896e8.zip |
Fix and add skipping ping log tests
Diffstat (limited to 'shared/extra-utils/server')
-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, |