]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-playlists.ts
Also retry when fetching master m3u8 playlist
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-playlists.ts
index 71ca3e63ab6ab61e0e46a6668a38aaea4186345f..9d223de485f646fdcf5b21c4ad8d6881effea8b8 100644 (file)
@@ -1,22 +1,10 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
-import {
-  checkPlaylistFilesWereRemoved,
-  cleanupTests,
-  doubleFollow,
-  createMultipleServers,
-  PlaylistsCommand,
-  PeerTubeServer,
-  setAccessTokensToServers,
-  setDefaultVideoChannel,
-  testImage,
-  wait,
-  waitJobs
-} from '@shared/extra-utils'
+import { expect } from 'chai'
+import { checkPlaylistFilesWereRemoved, testImage } from '@server/tests/shared'
+import { wait } from '@shared/core-utils'
 import {
+  HttpStatusCode,
   VideoPlaylist,
   VideoPlaylistCreateResult,
   VideoPlaylistElementType,
@@ -24,8 +12,17 @@ import {
   VideoPlaylistType,
   VideoPrivacy
 } from '@shared/models'
-
-const expect = chai.expect
+import {
+  cleanupTests,
+  createMultipleServers,
+  doubleFollow,
+  PeerTubeServer,
+  PlaylistsCommand,
+  setAccessTokensToServers,
+  setDefaultAccountAvatar,
+  setDefaultVideoChannel,
+  waitJobs
+} from '@shared/server-commands'
 
 async function checkPlaylistElementType (
   servers: PeerTubeServer[],
@@ -73,13 +70,18 @@ describe('Test video playlists', function () {
   let commands: PlaylistsCommand[]
 
   before(async function () {
-    this.timeout(120000)
+    this.timeout(240000)
 
-    servers = await createMultipleServers(3, { transcoding: { enabled: false } })
+    servers = await createMultipleServers(3)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
     await setDefaultVideoChannel(servers)
+    await setDefaultAccountAvatar(servers)
+
+    for (const server of servers) {
+      await server.config.disableTranscoding()
+    }
 
     // Server 1 and server 2 follow each other
     await doubleFollow(servers[0], servers[1])
@@ -1047,7 +1049,7 @@ describe('Test video playlists', function () {
       this.timeout(30000)
 
       for (const server of servers) {
-        await checkPlaylistFilesWereRemoved(playlistServer1UUID, server.internalServerNumber)
+        await checkPlaylistFilesWereRemoved(playlistServer1UUID, server)
       }
     })