diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:47:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch) | |
tree | eaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/api/live | |
parent | 89d241a79c262b9775c233b73cff080043ebb5e6 (diff) | |
download | PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip |
Use an object to represent a server
Diffstat (limited to 'server/tests/api/live')
-rw-r--r-- | server/tests/api/live/live-constraints.ts | 8 | ||||
-rw-r--r-- | server/tests/api/live/live-permanent.ts | 8 | ||||
-rw-r--r-- | server/tests/api/live/live-save-replay.ts | 8 | ||||
-rw-r--r-- | server/tests/api/live/live-socket-messages.ts | 8 | ||||
-rw-r--r-- | server/tests/api/live/live-views.ts | 8 | ||||
-rw-r--r-- | server/tests/api/live/live.ts | 11 |
6 files changed, 25 insertions, 26 deletions
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 { | |||
8 | cleanupTests, | 8 | cleanupTests, |
9 | ConfigCommand, | 9 | ConfigCommand, |
10 | doubleFollow, | 10 | doubleFollow, |
11 | flushAndRunMultipleServers, | 11 | createMultipleServers, |
12 | ServerInfo, | 12 | PeerTubeServer, |
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | setDefaultVideoChannel, | 14 | setDefaultVideoChannel, |
15 | wait, | 15 | wait, |
@@ -19,7 +19,7 @@ import { | |||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
21 | describe('Test live constraints', function () { | 21 | describe('Test live constraints', function () { |
22 | let servers: ServerInfo[] = [] | 22 | let servers: PeerTubeServer[] = [] |
23 | let userId: number | 23 | let userId: number |
24 | let userAccessToken: string | 24 | let userAccessToken: string |
25 | let userChannelId: number | 25 | let userChannelId: number |
@@ -63,7 +63,7 @@ describe('Test live constraints', function () { | |||
63 | before(async function () { | 63 | before(async function () { |
64 | this.timeout(120000) | 64 | this.timeout(120000) |
65 | 65 | ||
66 | servers = await flushAndRunMultipleServers(2) | 66 | servers = await createMultipleServers(2) |
67 | 67 | ||
68 | // Get the access tokens | 68 | // Get the access tokens |
69 | await setAccessTokensToServers(servers) | 69 | 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 { | |||
7 | cleanupTests, | 7 | cleanupTests, |
8 | ConfigCommand, | 8 | ConfigCommand, |
9 | doubleFollow, | 9 | doubleFollow, |
10 | flushAndRunMultipleServers, | 10 | createMultipleServers, |
11 | ServerInfo, | 11 | PeerTubeServer, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | setDefaultVideoChannel, | 13 | setDefaultVideoChannel, |
14 | stopFfmpeg, | 14 | stopFfmpeg, |
@@ -19,7 +19,7 @@ import { | |||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
21 | describe('Permanent live', function () { | 21 | describe('Permanent live', function () { |
22 | let servers: ServerInfo[] = [] | 22 | let servers: PeerTubeServer[] = [] |
23 | let videoUUID: string | 23 | let videoUUID: string |
24 | 24 | ||
25 | async function createLiveWrapper (permanentLive: boolean) { | 25 | async function createLiveWrapper (permanentLive: boolean) { |
@@ -45,7 +45,7 @@ describe('Permanent live', function () { | |||
45 | before(async function () { | 45 | before(async function () { |
46 | this.timeout(120000) | 46 | this.timeout(120000) |
47 | 47 | ||
48 | servers = await flushAndRunMultipleServers(2) | 48 | servers = await createMultipleServers(2) |
49 | 49 | ||
50 | // Get the access tokens | 50 | // Get the access tokens |
51 | await setAccessTokensToServers(servers) | 51 | 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 { | |||
9 | cleanupTests, | 9 | cleanupTests, |
10 | ConfigCommand, | 10 | ConfigCommand, |
11 | doubleFollow, | 11 | doubleFollow, |
12 | flushAndRunMultipleServers, | 12 | createMultipleServers, |
13 | ServerInfo, | 13 | PeerTubeServer, |
14 | setAccessTokensToServers, | 14 | setAccessTokensToServers, |
15 | setDefaultVideoChannel, | 15 | setDefaultVideoChannel, |
16 | stopFfmpeg, | 16 | stopFfmpeg, |
@@ -23,7 +23,7 @@ import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' | |||
23 | const expect = chai.expect | 23 | const expect = chai.expect |
24 | 24 | ||
25 | describe('Save replay setting', function () { | 25 | describe('Save replay setting', function () { |
26 | let servers: ServerInfo[] = [] | 26 | let servers: PeerTubeServer[] = [] |
27 | let liveVideoUUID: string | 27 | let liveVideoUUID: string |
28 | let ffmpegCommand: FfmpegCommand | 28 | let ffmpegCommand: FfmpegCommand |
29 | 29 | ||
@@ -82,7 +82,7 @@ describe('Save replay setting', function () { | |||
82 | before(async function () { | 82 | before(async function () { |
83 | this.timeout(120000) | 83 | this.timeout(120000) |
84 | 84 | ||
85 | servers = await flushAndRunMultipleServers(2) | 85 | servers = await createMultipleServers(2) |
86 | 86 | ||
87 | // Get the access tokens | 87 | // Get the access tokens |
88 | await setAccessTokensToServers(servers) | 88 | 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' | |||
6 | import { | 6 | import { |
7 | cleanupTests, | 7 | cleanupTests, |
8 | doubleFollow, | 8 | doubleFollow, |
9 | flushAndRunMultipleServers, | 9 | createMultipleServers, |
10 | ServerInfo, | 10 | PeerTubeServer, |
11 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
12 | setDefaultVideoChannel, | 12 | setDefaultVideoChannel, |
13 | stopFfmpeg, | 13 | stopFfmpeg, |
@@ -19,12 +19,12 @@ import { | |||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
21 | describe('Test live', function () { | 21 | describe('Test live', function () { |
22 | let servers: ServerInfo[] = [] | 22 | let servers: PeerTubeServer[] = [] |
23 | 23 | ||
24 | before(async function () { | 24 | before(async function () { |
25 | this.timeout(120000) | 25 | this.timeout(120000) |
26 | 26 | ||
27 | servers = await flushAndRunMultipleServers(2) | 27 | servers = await createMultipleServers(2) |
28 | 28 | ||
29 | // Get the access tokens | 29 | // Get the access tokens |
30 | await setAccessTokensToServers(servers) | 30 | 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' | |||
7 | import { | 7 | import { |
8 | cleanupTests, | 8 | cleanupTests, |
9 | doubleFollow, | 9 | doubleFollow, |
10 | flushAndRunMultipleServers, | 10 | createMultipleServers, |
11 | ServerInfo, | 11 | PeerTubeServer, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | setDefaultVideoChannel, | 13 | setDefaultVideoChannel, |
14 | stopFfmpeg, | 14 | stopFfmpeg, |
@@ -20,12 +20,12 @@ import { | |||
20 | const expect = chai.expect | 20 | const expect = chai.expect |
21 | 21 | ||
22 | describe('Test live', function () { | 22 | describe('Test live', function () { |
23 | let servers: ServerInfo[] = [] | 23 | let servers: PeerTubeServer[] = [] |
24 | 24 | ||
25 | before(async function () { | 25 | before(async function () { |
26 | this.timeout(120000) | 26 | this.timeout(120000) |
27 | 27 | ||
28 | servers = await flushAndRunMultipleServers(2) | 28 | servers = await createMultipleServers(2) |
29 | 29 | ||
30 | // Get the access tokens | 30 | // Get the access tokens |
31 | await setAccessTokensToServers(servers) | 31 | 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 { | |||
11 | checkResolutionsInMasterPlaylist, | 11 | checkResolutionsInMasterPlaylist, |
12 | cleanupTests, | 12 | cleanupTests, |
13 | doubleFollow, | 13 | doubleFollow, |
14 | flushAndRunMultipleServers, | 14 | createMultipleServers, |
15 | killallServers, | 15 | killallServers, |
16 | LiveCommand, | 16 | LiveCommand, |
17 | makeRawRequest, | 17 | makeRawRequest, |
18 | reRunServer, | ||
19 | sendRTMPStream, | 18 | sendRTMPStream, |
20 | ServerInfo, | 19 | PeerTubeServer, |
21 | setAccessTokensToServers, | 20 | setAccessTokensToServers, |
22 | setDefaultVideoChannel, | 21 | setDefaultVideoChannel, |
23 | stopFfmpeg, | 22 | stopFfmpeg, |
@@ -32,13 +31,13 @@ import { LiveVideo, LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState, Vid | |||
32 | const expect = chai.expect | 31 | const expect = chai.expect |
33 | 32 | ||
34 | describe('Test live', function () { | 33 | describe('Test live', function () { |
35 | let servers: ServerInfo[] = [] | 34 | let servers: PeerTubeServer[] = [] |
36 | let commands: LiveCommand[] | 35 | let commands: LiveCommand[] |
37 | 36 | ||
38 | before(async function () { | 37 | before(async function () { |
39 | this.timeout(120000) | 38 | this.timeout(120000) |
40 | 39 | ||
41 | servers = await flushAndRunMultipleServers(2) | 40 | servers = await createMultipleServers(2) |
42 | 41 | ||
43 | // Get the access tokens | 42 | // Get the access tokens |
44 | await setAccessTokensToServers(servers) | 43 | await setAccessTokensToServers(servers) |
@@ -571,7 +570,7 @@ describe('Test live', function () { | |||
571 | await commands[0].waitUntilSegmentGeneration({ videoUUID: liveVideoReplayId, resolution: 0, segment: 2 }) | 570 | await commands[0].waitUntilSegmentGeneration({ videoUUID: liveVideoReplayId, resolution: 0, segment: 2 }) |
572 | 571 | ||
573 | await killallServers([ servers[0] ]) | 572 | await killallServers([ servers[0] ]) |
574 | await reRunServer(servers[0]) | 573 | await servers[0].run() |
575 | 574 | ||
576 | await wait(5000) | 575 | await wait(5000) |
577 | }) | 576 | }) |