From ca5c612bfdd225433bcc6ace01c8024df3f674ba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Nov 2020 15:22:56 +0100 Subject: Add live transcoding bit rate tests --- shared/extra-utils/server/plugins.ts | 12 ++++++------ shared/extra-utils/server/servers.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'shared/extra-utils/server') diff --git a/shared/extra-utils/server/plugins.ts b/shared/extra-utils/server/plugins.ts index b6b5e3958..8f370f655 100644 --- a/shared/extra-utils/server/plugins.ts +++ b/shared/extra-utils/server/plugins.ts @@ -1,10 +1,10 @@ -import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' -import { PluginType } from '../../models/plugins/plugin.type' -import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' import { readJSON, writeJSON } from 'fs-extra' -import { ServerInfo } from './servers' -import { root } from '../miscs/miscs' import { join } from 'path' +import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' +import { PluginType } from '../../models/plugins/plugin.type' +import { buildServerDirectory, root } from '../miscs/miscs' +import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' +import { ServerInfo } from './servers' function listPlugins (parameters: { url: string @@ -216,7 +216,7 @@ function getPluginsCSS (url: string) { } function getPackageJSONPath (server: ServerInfo, npmName: string) { - return join(root(), 'test' + server.internalServerNumber, 'plugins', 'node_modules', npmName, 'package.json') + return buildServerDirectory(server, join('plugins', 'node_modules', npmName, 'package.json')) } function updatePluginPackageJSON (server: ServerInfo, npmName: string, json: any) { diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index 75e79cc41..1126a7d93 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts @@ -6,7 +6,7 @@ import { copy, pathExists, readdir, readFile, remove } from 'fs-extra' import { join } from 'path' import { randomInt } from '../../core-utils/miscs/miscs' import { VideoChannel } from '../../models/videos' -import { getFileSize, root, wait } from '../miscs/miscs' +import { buildServerDirectory, getFileSize, root, wait } from '../miscs/miscs' interface ServerInfo { app: ChildProcess @@ -309,7 +309,7 @@ function cleanupTests (servers: ServerInfo[]) { } async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictCount = true) { - const logfile = join(root(), 'test' + server.internalServerNumber, 'logs/peertube.log') + const logfile = buildServerDirectory(server, 'logs/peertube.log') while (true) { const buf = await readFile(logfile) @@ -323,7 +323,7 @@ async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictC } async function getServerFileSize (server: ServerInfo, subPath: string) { - const path = join(root(), 'test' + server.internalServerNumber, subPath) + const path = buildServerDirectory(server, subPath) return getFileSize(path) } -- cgit v1.2.3