]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/bulk.ts
Correctly wait for live segment generation
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / bulk.ts
index acc17092d4a99a24f004bc9cf8f948988ee2f99e..66d791a0f2cb13dea859e28489f3df42c5dbd71d 100644 (file)
@@ -1,23 +1,20 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
 import {
   BulkCommand,
   cleanupTests,
+  createMultipleServers,
   doubleFollow,
-  flushAndRunMultipleServers,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers,
   waitJobs
-} from '@shared/extra-utils'
-
-const expect = chai.expect
+} from '@shared/server-commands'
 
 describe('Test bulk actions', function () {
   const commentsUser3: { videoId: number, commentId: number }[] = []
 
-  let servers: ServerInfo[] = []
+  let servers: PeerTubeServer[] = []
   let user1Token: string
   let user2Token: string
   let user3Token: string
@@ -25,9 +22,9 @@ describe('Test bulk actions', function () {
   let bulkCommand: BulkCommand
 
   before(async function () {
-    this.timeout(30000)
+    this.timeout(120000)
 
-    servers = await flushAndRunMultipleServers(2)
+    servers = await createMultipleServers(2)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
@@ -80,7 +77,7 @@ describe('Test bulk actions', function () {
           const { data } = await servers[1].comments.listThreads({ videoId: video.id })
           const comment = data.find(c => c.text === 'comment by user 3')
 
-          if (video.account.host === 'localhost:' + servers[0].port) {
+          if (video.account.host === servers[0].host) {
             expect(comment).to.not.exist
           } else {
             expect(comment).to.exist
@@ -90,7 +87,7 @@ describe('Test bulk actions', function () {
     }
 
     before(async function () {
-      this.timeout(120000)
+      this.timeout(240000)
 
       await servers[0].videos.upload({ attributes: { name: 'video 1 server 1' } })
       await servers[0].videos.upload({ attributes: { name: 'video 2 server 1' } })
@@ -154,7 +151,7 @@ describe('Test bulk actions', function () {
 
       await bulkCommand.removeCommentsOf({
         attributes: {
-          accountName: 'user3@localhost:' + servers[1].port,
+          accountName: 'user3@' + servers[1].host,
           scope: 'instance'
         }
       })