import 'mocha'
import * as chai from 'chai'
import { VideoDetails } from '../../../shared/models/videos'
-const expect = chai.expect
-
import {
+ doubleFollow,
execCLI,
+ flushAndRunMultipleServers,
flushTests,
getEnvCli,
+ getVideo,
getVideosList,
killallServers,
- parseTorrentVideo,
- runServer,
ServerInfo,
setAccessTokensToServers,
- uploadVideo,
- wait,
- getVideo, flushAndRunMultipleServers, doubleFollow
+ uploadVideo, wait
} from '../utils'
+import { waitJobs } from '../utils/server/jobs'
+
+const expect = chai.expect
describe('Test create transcoding jobs', function () {
let servers: ServerInfo[] = []
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video2' })
video2UUID = res.body.video.uuid
- await wait(3000)
+ await waitJobs(servers)
})
it('Should have two video files on each server', async function () {
const env = getEnvCli(servers[0])
await execCLI(`${env} npm run create-transcoding-job -- -v ${video2UUID}`)
- await wait(40000)
+ await waitJobs(servers)
for (const server of servers) {
const res = await getVideosList(server.url)
after(async function () {
killallServers(servers)
-
- // Keep the logs if the test failed
- if (this['ok']) {
- await flushTests()
- }
})
})