Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Aug 14, 2024
1 parent be4bf80 commit 7d52f17
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/server-commands/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 ] } } } }
: {}

Expand Down
6 changes: 3 additions & 3 deletions packages/tests/src/api/server/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
})
Expand All @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/peertube-runner/vod-transcoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 7d52f17

Please sign in to comment.