Fix tests
This commit is contained in:
parent
be4bf80883
commit
7d52f17a35
|
@ -61,6 +61,7 @@ import { StatsCommand } from './stats-command.js'
|
|||
import merge from 'lodash-es/merge.js'
|
||||
|
||||
export type RunServerOptions = {
|
||||
autoEnableImportProxy?: boolean
|
||||
hideLogs?: boolean
|
||||
nodeArgs?: string[]
|
||||
peertubeArgs?: string[]
|
||||
|
@ -241,7 +242,7 @@ export class PeerTubeServer {
|
|||
|
||||
await this.assignCustomConfigFile()
|
||||
|
||||
let configOverride = this.buildConfigOverride()
|
||||
let configOverride = this.buildConfigOverride(options)
|
||||
|
||||
if (configOverrideArg !== undefined) {
|
||||
configOverride = merge(configOverride, configOverrideArg)
|
||||
|
@ -363,8 +364,8 @@ export class PeerTubeServer {
|
|||
this.customConfigFile = tmpConfigFile
|
||||
}
|
||||
|
||||
private buildConfigOverride () {
|
||||
const base = process.env.YOUTUBE_DL_PROXY
|
||||
private buildConfigOverride (options: RunServerOptions) {
|
||||
const base = options.autoEnableImportProxy !== false && process.env.YOUTUBE_DL_PROXY
|
||||
? { import: { videos: { http: { proxies: [ process.env.YOUTUBE_DL_PROXY ] } } } }
|
||||
: {}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ describe('Test proxy', function () {
|
|||
this.timeout(240000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run(getProxyConfig(null), { env: goodEnv })
|
||||
await servers[0].run({}, { env: goodEnv, autoEnableImportProxy: false })
|
||||
|
||||
await quickImport()
|
||||
|
||||
|
@ -129,7 +129,7 @@ describe('Test proxy', function () {
|
|||
this.timeout(120000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run(getProxyConfig(null), { env: badEnv })
|
||||
await servers[0].run({}, { env: badEnv, autoEnableImportProxy: false })
|
||||
|
||||
await quickImport(HttpStatusCode.BAD_REQUEST_400)
|
||||
})
|
||||
|
@ -138,7 +138,7 @@ describe('Test proxy', function () {
|
|||
this.timeout(120000)
|
||||
|
||||
await servers[0].kill()
|
||||
await servers[0].run(getProxyConfig('http://localhost:9000'))
|
||||
await servers[0].run(getProxyConfig('http://localhost:9000'), { autoEnableImportProxy: false })
|
||||
|
||||
await quickImport(HttpStatusCode.BAD_REQUEST_400)
|
||||
})
|
||||
|
|
|
@ -269,7 +269,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
|
|||
describe('Web video only enabled', function () {
|
||||
|
||||
before(async function () {
|
||||
await servers[0].config.enableTranscoding({ webVideo: true, hls: false, with0p: true })
|
||||
await servers[0].config.enableTranscoding({ resolutions: 'max', webVideo: true, hls: false, with0p: true })
|
||||
})
|
||||
|
||||
runSpecificSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage })
|
||||
|
|
Loading…
Reference in New Issue