From c655c9ef6f7ddb47a153adc04d5c10c6de3d5ed7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Nov 2020 16:43:43 +0100 Subject: Update ffmpeg static version for tests --- shared/extra-utils/server/servers.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'shared') diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index b4bd55968..e26a6937c 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */ +import { expect } from 'chai' import { ChildProcess, exec, fork } from 'child_process' -import { join } from 'path' -import { root, wait } from '../miscs/miscs' import { copy, pathExists, readdir, readFile, remove } from 'fs-extra' -import { expect } from 'chai' -import { VideoChannel } from '../../models/videos' +import { join } from 'path' import { randomInt } from '../../core-utils/miscs/miscs' +import { VideoChannel } from '../../models/videos' +import { root, wait } from '../miscs/miscs' interface ServerInfo { app: ChildProcess @@ -16,6 +16,8 @@ interface ServerInfo { hostname: string port: number + rtmpPort: number + parallel: boolean internalServerNumber: number serverNumber: number @@ -95,10 +97,18 @@ function randomServer () { return randomInt(low, high) } +function randomRTMP () { + const low = 1900 + const high = 2100 + + return randomInt(low, high) +} + async function flushAndRunServer (serverNumber: number, configOverride?: Object, args = []) { const parallel = parallelTests() const internalServerNumber = parallel ? randomServer() : serverNumber + const rtmpPort = parallel ? randomRTMP() : null const port = 9000 + internalServerNumber await flushTests(internalServerNumber) @@ -107,6 +117,7 @@ async function flushAndRunServer (serverNumber: number, configOverride?: Object, app: null, port, internalServerNumber, + rtmpPort, parallel, serverNumber, url: `http://localhost:${port}`, @@ -178,6 +189,11 @@ async function runServer (server: ServerInfo, configOverrideArg?: any, args = [] }, admin: { email: `admin${server.internalServerNumber}@example.com` + }, + live: { + rtmp: { + port: server.rtmpPort + } } }) } -- cgit v1.2.3