diff options
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/plugins.ts | 12 | ||||
-rw-r--r-- | shared/extra-utils/server/servers.ts | 6 |
2 files changed, 9 insertions, 9 deletions
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 @@ | |||
1 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' | ||
2 | import { PluginType } from '../../models/plugins/plugin.type' | ||
3 | import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' | ||
4 | import { readJSON, writeJSON } from 'fs-extra' | 1 | import { readJSON, writeJSON } from 'fs-extra' |
5 | import { ServerInfo } from './servers' | ||
6 | import { root } from '../miscs/miscs' | ||
7 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' | ||
4 | import { PluginType } from '../../models/plugins/plugin.type' | ||
5 | import { buildServerDirectory, root } from '../miscs/miscs' | ||
6 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' | ||
7 | import { ServerInfo } from './servers' | ||
8 | 8 | ||
9 | function listPlugins (parameters: { | 9 | function listPlugins (parameters: { |
10 | url: string | 10 | url: string |
@@ -216,7 +216,7 @@ function getPluginsCSS (url: string) { | |||
216 | } | 216 | } |
217 | 217 | ||
218 | function getPackageJSONPath (server: ServerInfo, npmName: string) { | 218 | function getPackageJSONPath (server: ServerInfo, npmName: string) { |
219 | return join(root(), 'test' + server.internalServerNumber, 'plugins', 'node_modules', npmName, 'package.json') | 219 | return buildServerDirectory(server, join('plugins', 'node_modules', npmName, 'package.json')) |
220 | } | 220 | } |
221 | 221 | ||
222 | function updatePluginPackageJSON (server: ServerInfo, npmName: string, json: any) { | 222 | 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' | |||
6 | import { join } from 'path' | 6 | 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 { getFileSize, root, wait } from '../miscs/miscs' | 9 | import { buildServerDirectory, getFileSize, root, wait } from '../miscs/miscs' |
10 | 10 | ||
11 | interface ServerInfo { | 11 | interface ServerInfo { |
12 | app: ChildProcess | 12 | app: ChildProcess |
@@ -309,7 +309,7 @@ function cleanupTests (servers: ServerInfo[]) { | |||
309 | } | 309 | } |
310 | 310 | ||
311 | async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictCount = true) { | 311 | async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictCount = true) { |
312 | const logfile = join(root(), 'test' + server.internalServerNumber, 'logs/peertube.log') | 312 | const logfile = buildServerDirectory(server, 'logs/peertube.log') |
313 | 313 | ||
314 | while (true) { | 314 | while (true) { |
315 | const buf = await readFile(logfile) | 315 | const buf = await readFile(logfile) |
@@ -323,7 +323,7 @@ async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictC | |||
323 | } | 323 | } |
324 | 324 | ||
325 | async function getServerFileSize (server: ServerInfo, subPath: string) { | 325 | async function getServerFileSize (server: ServerInfo, subPath: string) { |
326 | const path = join(root(), 'test' + server.internalServerNumber, subPath) | 326 | const path = buildServerDirectory(server, subPath) |
327 | 327 | ||
328 | return getFileSize(path) | 328 | return getFileSize(path) |
329 | } | 329 | } |