import { randomInt } from '../../core-utils/miscs/miscs'
import { VideoChannel } from '../../models/videos'
import { buildServerDirectory, getFileSize, isGithubCI, root, wait } from '../miscs/miscs'
+import { makeGetRequest } from '../requests/requests'
interface ServerInfo {
app: ChildProcess
async function runServer (server: ServerInfo, configOverrideArg?: any, args = [], options: RunServerOptions = {}) {
// These actions are async so we need to be sure that they have both been done
const serverRunString = {
- 'Server listening': false
+ 'HTTP server listening': false
}
const key = 'Database peertube_test' + server.internalServerNumber + ' is ready'
serverRunString[key] = false
return getFileSize(path)
}
+function makePingRequest (server: ServerInfo) {
+ return makeGetRequest({
+ url: server.url,
+ path: '/api/v1/ping',
+ statusCodeExpected: 200
+ })
+}
+
// ---------------------------------------------------------------------------
export {
cleanupTests,
flushAndRunMultipleServers,
flushTests,
+ makePingRequest,
flushAndRunServer,
killallServers,
reRunServer,