diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 15:00:01 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | d102de1b38f2877463529c3b27bd35ffef4fd8bf (patch) | |
tree | 31fa0bdf26ad7a2ee46d600d804a6f03260266c8 /server/tests/shared/live.ts | |
parent | 2fe978744e5b74eb824e4d79c1bb9b840169f125 (diff) | |
download | PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.gz PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.zst PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.zip |
Add runner server tests
Diffstat (limited to 'server/tests/shared/live.ts')
-rw-r--r-- | server/tests/shared/live.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/tests/shared/live.ts b/server/tests/shared/live.ts index ff0b2f226..31f92ef19 100644 --- a/server/tests/shared/live.ts +++ b/server/tests/shared/live.ts | |||
@@ -6,6 +6,7 @@ import { join } from 'path' | |||
6 | import { sha1 } from '@shared/extra-utils' | 6 | import { sha1 } from '@shared/extra-utils' |
7 | import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models' | 7 | import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models' |
8 | import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands' | 8 | import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands' |
9 | import { SQLCommand } from './sql-command' | ||
9 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists' | 10 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists' |
10 | 11 | ||
11 | async function checkLiveCleanup (options: { | 12 | async function checkLiveCleanup (options: { |
@@ -36,8 +37,10 @@ async function checkLiveCleanup (options: { | |||
36 | 37 | ||
37 | // --------------------------------------------------------------------------- | 38 | // --------------------------------------------------------------------------- |
38 | 39 | ||
39 | async function testVideoResolutions (options: { | 40 | async function testLiveVideoResolutions (options: { |
41 | sqlCommand: SQLCommand | ||
40 | originServer: PeerTubeServer | 42 | originServer: PeerTubeServer |
43 | |||
41 | servers: PeerTubeServer[] | 44 | servers: PeerTubeServer[] |
42 | liveVideoId: string | 45 | liveVideoId: string |
43 | resolutions: number[] | 46 | resolutions: number[] |
@@ -48,6 +51,7 @@ async function testVideoResolutions (options: { | |||
48 | }) { | 51 | }) { |
49 | const { | 52 | const { |
50 | originServer, | 53 | originServer, |
54 | sqlCommand, | ||
51 | servers, | 55 | servers, |
52 | liveVideoId, | 56 | liveVideoId, |
53 | resolutions, | 57 | resolutions, |
@@ -116,7 +120,7 @@ async function testVideoResolutions (options: { | |||
116 | 120 | ||
117 | if (originServer.internalServerNumber === server.internalServerNumber) { | 121 | if (originServer.internalServerNumber === server.internalServerNumber) { |
118 | const infohash = sha1(`${2 + hlsPlaylist.playlistUrl}+V${i}`) | 122 | const infohash = sha1(`${2 + hlsPlaylist.playlistUrl}+V${i}`) |
119 | const dbInfohashes = await originServer.sql.getPlaylistInfohash(hlsPlaylist.id) | 123 | const dbInfohashes = await sqlCommand.getPlaylistInfohash(hlsPlaylist.id) |
120 | 124 | ||
121 | expect(dbInfohashes).to.include(infohash) | 125 | expect(dbInfohashes).to.include(infohash) |
122 | } | 126 | } |
@@ -128,7 +132,7 @@ async function testVideoResolutions (options: { | |||
128 | 132 | ||
129 | export { | 133 | export { |
130 | checkLiveCleanup, | 134 | checkLiveCleanup, |
131 | testVideoResolutions | 135 | testLiveVideoResolutions |
132 | } | 136 | } |
133 | 137 | ||
134 | // --------------------------------------------------------------------------- | 138 | // --------------------------------------------------------------------------- |