aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-19 11:23:51 +0100
committerChocobozzz <me@florianbigard.com>2021-02-19 11:27:38 +0100
commit300cb723eb9bd219e6d381c57a8a6a860563bbbb (patch)
tree4af4b272d174c195c81285ad49325c4e7a2f7707 /server
parent2a021e6cb6836864bb013d5ff451e8a4ae45c9b7 (diff)
downloadPeerTube-300cb723eb9bd219e6d381c57a8a6a860563bbbb.tar.gz
PeerTube-300cb723eb9bd219e6d381c57a8a6a860563bbbb.tar.zst
PeerTube-300cb723eb9bd219e6d381c57a8a6a860563bbbb.zip
Fix tests
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos/comment.ts3
-rw-r--r--server/tests/api/live/live-constraints.ts12
2 files changed, 12 insertions, 3 deletions
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index 38fa7c3b0..f1f53d354 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -1,4 +1,5 @@
1import * as express from 'express' 1import * as express from 'express'
2import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
2import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models' 3import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models'
3import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model' 4import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model'
4import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' 5import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
@@ -29,8 +30,6 @@ import {
29} from '../../../middlewares/validators' 30} from '../../../middlewares/validators'
30import { AccountModel } from '../../../models/account/account' 31import { AccountModel } from '../../../models/account/account'
31import { VideoCommentModel } from '../../../models/video/video-comment' 32import { VideoCommentModel } from '../../../models/video/video-comment'
32import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
33import { logger } from '@server/helpers/logger'
34 33
35const auditLogger = auditLoggerFactory('comments') 34const auditLogger = auditLoggerFactory('comments')
36const videoCommentRouter = express.Router() 35const videoCommentRouter = express.Router()
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index 1c60a7c76..5569e6066 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -20,7 +20,8 @@ import {
20 updateUser, 20 updateUser,
21 userLogin, 21 userLogin,
22 wait, 22 wait,
23 waitJobs 23 waitJobs,
24 waitUntilLivePublished
24} from '../../../../shared/extra-utils' 25} from '../../../../shared/extra-utils'
25 26
26const expect = chai.expect 27const expect = chai.expect
@@ -55,6 +56,12 @@ describe('Test live constraints', function () {
55 await checkLiveCleanup(servers[0], videoId, resolutions) 56 await checkLiveCleanup(servers[0], videoId, resolutions)
56 } 57 }
57 58
59 async function waitUntilLivePublishedOnAllServers (videoId: string) {
60 for (const server of servers) {
61 await waitUntilLivePublished(server.url, server.accessToken, videoId)
62 }
63 }
64
58 before(async function () { 65 before(async function () {
59 this.timeout(120000) 66 this.timeout(120000)
60 67
@@ -118,6 +125,7 @@ describe('Test live constraints', function () {
118 const userVideoLiveoId = await createLiveWrapper(true) 125 const userVideoLiveoId = await createLiveWrapper(true)
119 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) 126 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
120 127
128 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
121 await waitJobs(servers) 129 await waitJobs(servers)
122 130
123 await checkSaveReplay(userVideoLiveoId) 131 await checkSaveReplay(userVideoLiveoId)
@@ -140,6 +148,7 @@ describe('Test live constraints', function () {
140 const userVideoLiveoId = await createLiveWrapper(true) 148 const userVideoLiveoId = await createLiveWrapper(true)
141 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) 149 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
142 150
151 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
143 await waitJobs(servers) 152 await waitJobs(servers)
144 153
145 await checkSaveReplay(userVideoLiveoId) 154 await checkSaveReplay(userVideoLiveoId)
@@ -189,6 +198,7 @@ describe('Test live constraints', function () {
189 const userVideoLiveoId = await createLiveWrapper(true) 198 const userVideoLiveoId = await createLiveWrapper(true)
190 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true) 199 await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
191 200
201 await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
192 await waitJobs(servers) 202 await waitJobs(servers)
193 203
194 await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ]) 204 await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ])