From 254d3579f5338f5fd775c17d15cdfc37078bcfb4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:47:51 +0200 Subject: Use an object to represent a server --- server/tests/api/live/live-constraints.ts | 8 ++++---- server/tests/api/live/live-permanent.ts | 8 ++++---- server/tests/api/live/live-save-replay.ts | 8 ++++---- server/tests/api/live/live-socket-messages.ts | 8 ++++---- server/tests/api/live/live-views.ts | 8 ++++---- server/tests/api/live/live.ts | 11 +++++------ 6 files changed, 25 insertions(+), 26 deletions(-) (limited to 'server/tests/api/live') diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index 1c380883c..a00833569 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts @@ -8,8 +8,8 @@ import { cleanupTests, ConfigCommand, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + createMultipleServers, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, wait, @@ -19,7 +19,7 @@ import { const expect = chai.expect describe('Test live constraints', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let userId: number let userAccessToken: string let userChannelId: number @@ -63,7 +63,7 @@ describe('Test live constraints', function () { before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts index 900bd6f5c..30d499e20 100644 --- a/server/tests/api/live/live-permanent.ts +++ b/server/tests/api/live/live-permanent.ts @@ -7,8 +7,8 @@ import { cleanupTests, ConfigCommand, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + createMultipleServers, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, @@ -19,7 +19,7 @@ import { const expect = chai.expect describe('Permanent live', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let videoUUID: string async function createLiveWrapper (permanentLive: boolean) { @@ -45,7 +45,7 @@ describe('Permanent live', function () { before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts index 7a33df90a..d403f27bf 100644 --- a/server/tests/api/live/live-save-replay.ts +++ b/server/tests/api/live/live-save-replay.ts @@ -9,8 +9,8 @@ import { cleanupTests, ConfigCommand, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + createMultipleServers, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, @@ -23,7 +23,7 @@ import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' const expect = chai.expect describe('Save replay setting', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let liveVideoUUID: string let ffmpegCommand: FfmpegCommand @@ -82,7 +82,7 @@ describe('Save replay setting', function () { before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts index ad67d6285..3808964d1 100644 --- a/server/tests/api/live/live-socket-messages.ts +++ b/server/tests/api/live/live-socket-messages.ts @@ -6,8 +6,8 @@ import { VideoPrivacy, VideoState } from '@shared/models' import { cleanupTests, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + createMultipleServers, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, @@ -19,12 +19,12 @@ import { const expect = chai.expect describe('Test live', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) diff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.ts index 43222f9c9..4a137b185 100644 --- a/server/tests/api/live/live-views.ts +++ b/server/tests/api/live/live-views.ts @@ -7,8 +7,8 @@ import { VideoPrivacy } from '@shared/models' import { cleanupTests, doubleFollow, - flushAndRunMultipleServers, - ServerInfo, + createMultipleServers, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, @@ -20,12 +20,12 @@ import { const expect = chai.expect describe('Test live', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 2cce1f448..7cfac522c 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -11,13 +11,12 @@ import { checkResolutionsInMasterPlaylist, cleanupTests, doubleFollow, - flushAndRunMultipleServers, + createMultipleServers, killallServers, LiveCommand, makeRawRequest, - reRunServer, sendRTMPStream, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, stopFfmpeg, @@ -32,13 +31,13 @@ import { LiveVideo, LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState, Vid const expect = chai.expect describe('Test live', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let commands: LiveCommand[] before(async function () { this.timeout(120000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) // Get the access tokens await setAccessTokensToServers(servers) @@ -571,7 +570,7 @@ describe('Test live', function () { await commands[0].waitUntilSegmentGeneration({ videoUUID: liveVideoReplayId, resolution: 0, segment: 2 }) await killallServers([ servers[0] ]) - await reRunServer(servers[0]) + await servers[0].run() await wait(5000) }) -- cgit v1.2.3