mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-20 11:48:31 -06:00
Fix tests
This commit is contained in:
parent
2a021e6cb6
commit
300cb723eb
@ -1,4 +1,5 @@
|
|||||||
import * as express from 'express'
|
import * as express from 'express'
|
||||||
|
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
||||||
import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models'
|
import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models'
|
||||||
import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model'
|
import { VideoCommentCreate } from '../../../../shared/models/videos/video-comment.model'
|
||||||
import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
|
import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
|
||||||
@ -29,8 +30,6 @@ import {
|
|||||||
} from '../../../middlewares/validators'
|
} from '../../../middlewares/validators'
|
||||||
import { AccountModel } from '../../../models/account/account'
|
import { AccountModel } from '../../../models/account/account'
|
||||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||||
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
|
||||||
import { logger } from '@server/helpers/logger'
|
|
||||||
|
|
||||||
const auditLogger = auditLoggerFactory('comments')
|
const auditLogger = auditLoggerFactory('comments')
|
||||||
const videoCommentRouter = express.Router()
|
const videoCommentRouter = express.Router()
|
||||||
|
@ -20,7 +20,8 @@ import {
|
|||||||
updateUser,
|
updateUser,
|
||||||
userLogin,
|
userLogin,
|
||||||
wait,
|
wait,
|
||||||
waitJobs
|
waitJobs,
|
||||||
|
waitUntilLivePublished
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
@ -55,6 +56,12 @@ describe('Test live constraints', function () {
|
|||||||
await checkLiveCleanup(servers[0], videoId, resolutions)
|
await checkLiveCleanup(servers[0], videoId, resolutions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function waitUntilLivePublishedOnAllServers (videoId: string) {
|
||||||
|
for (const server of servers) {
|
||||||
|
await waitUntilLivePublished(server.url, server.accessToken, videoId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
@ -118,6 +125,7 @@ describe('Test live constraints', function () {
|
|||||||
const userVideoLiveoId = await createLiveWrapper(true)
|
const userVideoLiveoId = await createLiveWrapper(true)
|
||||||
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
||||||
|
|
||||||
|
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId)
|
await checkSaveReplay(userVideoLiveoId)
|
||||||
@ -140,6 +148,7 @@ describe('Test live constraints', function () {
|
|||||||
const userVideoLiveoId = await createLiveWrapper(true)
|
const userVideoLiveoId = await createLiveWrapper(true)
|
||||||
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
||||||
|
|
||||||
|
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId)
|
await checkSaveReplay(userVideoLiveoId)
|
||||||
@ -189,6 +198,7 @@ describe('Test live constraints', function () {
|
|||||||
const userVideoLiveoId = await createLiveWrapper(true)
|
const userVideoLiveoId = await createLiveWrapper(true)
|
||||||
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
await runAndTestFfmpegStreamError(servers[0].url, userAccessToken, userVideoLiveoId, true)
|
||||||
|
|
||||||
|
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
||||||
await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ])
|
await checkSaveReplay(userVideoLiveoId, [ 720, 480, 360, 240 ])
|
||||||
|
Loading…
Reference in New Issue
Block a user