X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fconfig.ts;h=22446fe0c9c2863ccf8dda6d724af9a8f2e18e87;hb=77239b425a8e00822a53c9907415832a473c3eb6;hp=2e6617a15427d31a3c00c020a9437251e8100a19;hpb=bf54587a3e2ad9c2c186828f2a5682b91ee2cc00;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 2e6617a15..22446fe0c 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -1,19 +1,16 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' +import { expect } from 'chai' +import { parallelTests } from '@shared/core-utils' +import { CustomConfig, HttpStatusCode } from '@shared/models' import { cleanupTests, createSingleServer, killallServers, makeGetRequest, - parallelTests, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' -import { CustomConfig, HttpStatusCode } from '@shared/models' - -const expect = chai.expect function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { expect(data.instance.name).to.equal('PeerTube') @@ -77,11 +74,13 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { expect(data.transcoding.resolutions['1080p']).to.be.true expect(data.transcoding.resolutions['1440p']).to.be.true expect(data.transcoding.resolutions['2160p']).to.be.true + expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.true expect(data.transcoding.webtorrent.enabled).to.be.true expect(data.transcoding.hls.enabled).to.be.true expect(data.live.enabled).to.be.false expect(data.live.allowReplay).to.be.false + expect(data.live.latencySetting.enabled).to.be.true expect(data.live.maxDuration).to.equal(-1) expect(data.live.maxInstanceLives).to.equal(20) expect(data.live.maxUserLives).to.equal(3) @@ -96,6 +95,9 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { expect(data.live.transcoding.resolutions['1080p']).to.be.false expect(data.live.transcoding.resolutions['1440p']).to.be.false expect(data.live.transcoding.resolutions['2160p']).to.be.false + expect(data.live.transcoding.alwaysTranscodeOriginalResolution).to.be.true + + expect(data.videoStudio.enabled).to.be.false expect(data.import.videos.concurrency).to.equal(2) expect(data.import.videos.http.enabled).to.be.true @@ -178,11 +180,13 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.transcoding.resolutions['720p']).to.be.false expect(data.transcoding.resolutions['1080p']).to.be.false expect(data.transcoding.resolutions['2160p']).to.be.false + expect(data.transcoding.alwaysTranscodeOriginalResolution).to.be.false expect(data.transcoding.hls.enabled).to.be.false expect(data.transcoding.webtorrent.enabled).to.be.true expect(data.live.enabled).to.be.true expect(data.live.allowReplay).to.be.true + expect(data.live.latencySetting.enabled).to.be.false expect(data.live.maxDuration).to.equal(5000) expect(data.live.maxInstanceLives).to.equal(-1) expect(data.live.maxUserLives).to.equal(10) @@ -196,6 +200,9 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.live.transcoding.resolutions['720p']).to.be.true expect(data.live.transcoding.resolutions['1080p']).to.be.true expect(data.live.transcoding.resolutions['2160p']).to.be.true + expect(data.live.transcoding.alwaysTranscodeOriginalResolution).to.be.false + + expect(data.videoStudio.enabled).to.be.true expect(data.import.videos.concurrency).to.equal(4) expect(data.import.videos.http.enabled).to.be.false @@ -312,6 +319,7 @@ const newCustomConfig: CustomConfig = { '1440p': false, '2160p': false }, + alwaysTranscodeOriginalResolution: false, webtorrent: { enabled: true }, @@ -322,6 +330,9 @@ const newCustomConfig: CustomConfig = { live: { enabled: true, allowReplay: true, + latencySetting: { + enabled: false + }, maxDuration: 5000, maxInstanceLives: -1, maxUserLives: 10, @@ -338,9 +349,13 @@ const newCustomConfig: CustomConfig = { '1080p': true, '1440p': true, '2160p': true - } + }, + alwaysTranscodeOriginalResolution: false } }, + videoStudio: { + enabled: true + }, import: { videos: { concurrency: 4, @@ -350,12 +365,16 @@ const newCustomConfig: CustomConfig = { torrent: { enabled: false } + }, + videoChannelSynchronization: { + enabled: false, + maxPerUser: 10 } }, trending: { videos: { algorithms: { - enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ], + enabled: [ 'hot', 'most-viewed', 'most-liked' ], default: 'hot' } } @@ -487,7 +506,7 @@ describe('Test config', function () { }) it('Should have the correct updated video allowed extensions', async function () { - this.timeout(10000) + this.timeout(30000) const data = await server.config.getConfig()