]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/redundancy/redundancy.ts
Introduce streaming playlists command
[github/Chocobozzz/PeerTube.git] / server / tests / api / redundancy / redundancy.ts
index 5b970473c054ea1c7b6ed4e195586df67dd405c4..d20cb80f10fd5e2bf5470fd1c8a258393f465a42 100644 (file)
@@ -5,7 +5,6 @@ import * as chai from 'chai'
 import { readdir } from 'fs-extra'
 import * as magnetUtil from 'magnet-uri'
 import { join } from 'path'
-import { removeVideoRedundancy } from '@server/lib/redundancy'
 import { HttpStatusCode } from '@shared/core-utils'
 import {
   checkSegmentHash,
@@ -30,15 +29,7 @@ import {
   waitJobs,
   waitUntilLog
 } from '@shared/extra-utils'
-import { getStats } from '@shared/extra-utils/server/stats'
-import {
-  ServerStats,
-  VideoDetails,
-  VideoPrivacy,
-  VideoRedundancy,
-  VideoRedundancyStrategy,
-  VideoRedundancyStrategyWithManual
-} from '@shared/models'
+import { VideoDetails, VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@shared/models'
 
 const expect = chai.expect
 
@@ -212,7 +203,7 @@ async function check1PlaylistRedundancies (videoUUID?: string) {
   const hlsPlaylist = (res.body as VideoDetails).streamingPlaylists[0]
 
   for (const resolution of [ 240, 360, 480, 720 ]) {
-    await checkSegmentHash(baseUrlPlaylist, baseUrlSegment, videoUUID, resolution, hlsPlaylist)
+    await checkSegmentHash({ server: servers[1], baseUrlPlaylist, baseUrlSegment, videoUUID, resolution, hlsPlaylist })
   }
 
   const directories = [
@@ -241,9 +232,7 @@ async function checkStatsGlobal (strategy: VideoRedundancyStrategyWithManual) {
     statsLength = 2
   }
 
-  const res = await getStats(servers[0].url)
-  const data: ServerStats = res.body
-
+  const data = await servers[0].statsCommand.get()
   expect(data.videosRedundancy).to.have.lengthOf(statsLength)
 
   const stat = data.videosRedundancy[0]