aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/shared/live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-04-21 15:00:01 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commitd102de1b38f2877463529c3b27bd35ffef4fd8bf (patch)
tree31fa0bdf26ad7a2ee46d600d804a6f03260266c8 /server/tests/shared/live.ts
parent2fe978744e5b74eb824e4d79c1bb9b840169f125 (diff)
downloadPeerTube-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.ts10
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'
6import { sha1 } from '@shared/extra-utils' 6import { sha1 } from '@shared/extra-utils'
7import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models' 7import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
8import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands' 8import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
9import { SQLCommand } from './sql-command'
9import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists' 10import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
10 11
11async function checkLiveCleanup (options: { 12async function checkLiveCleanup (options: {
@@ -36,8 +37,10 @@ async function checkLiveCleanup (options: {
36 37
37// --------------------------------------------------------------------------- 38// ---------------------------------------------------------------------------
38 39
39async function testVideoResolutions (options: { 40async 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
129export { 133export {
130 checkLiveCleanup, 134 checkLiveCleanup,
131 testVideoResolutions 135 testLiveVideoResolutions
132} 136}
133 137
134// --------------------------------------------------------------------------- 138// ---------------------------------------------------------------------------