diff options
Diffstat (limited to 'server/tests/cli/create-transcoding-job.ts')
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index fe1c0c03d..e7c36f9c6 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts | |||
@@ -3,22 +3,22 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { VideoDetails } from '../../../shared/models/videos' | 5 | import { VideoDetails } from '../../../shared/models/videos' |
6 | const expect = chai.expect | ||
7 | |||
8 | import { | 6 | import { |
7 | doubleFollow, | ||
9 | execCLI, | 8 | execCLI, |
9 | flushAndRunMultipleServers, | ||
10 | flushTests, | 10 | flushTests, |
11 | getEnvCli, | 11 | getEnvCli, |
12 | getVideo, | ||
12 | getVideosList, | 13 | getVideosList, |
13 | killallServers, | 14 | killallServers, |
14 | parseTorrentVideo, | ||
15 | runServer, | ||
16 | ServerInfo, | 15 | ServerInfo, |
17 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
18 | uploadVideo, | 17 | uploadVideo, wait |
19 | wait, | ||
20 | getVideo, flushAndRunMultipleServers, doubleFollow | ||
21 | } from '../utils' | 18 | } from '../utils' |
19 | import { waitJobs } from '../utils/server/jobs' | ||
20 | |||
21 | const expect = chai.expect | ||
22 | 22 | ||
23 | describe('Test create transcoding jobs', function () { | 23 | describe('Test create transcoding jobs', function () { |
24 | let servers: ServerInfo[] = [] | 24 | let servers: ServerInfo[] = [] |
@@ -40,7 +40,7 @@ describe('Test create transcoding jobs', function () { | |||
40 | const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video2' }) | 40 | const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video2' }) |
41 | video2UUID = res.body.video.uuid | 41 | video2UUID = res.body.video.uuid |
42 | 42 | ||
43 | await wait(3000) | 43 | await waitJobs(servers) |
44 | }) | 44 | }) |
45 | 45 | ||
46 | it('Should have two video files on each server', async function () { | 46 | it('Should have two video files on each server', async function () { |
@@ -65,7 +65,7 @@ describe('Test create transcoding jobs', function () { | |||
65 | const env = getEnvCli(servers[0]) | 65 | const env = getEnvCli(servers[0]) |
66 | await execCLI(`${env} npm run create-transcoding-job -- -v ${video2UUID}`) | 66 | await execCLI(`${env} npm run create-transcoding-job -- -v ${video2UUID}`) |
67 | 67 | ||
68 | await wait(40000) | 68 | await waitJobs(servers) |
69 | 69 | ||
70 | for (const server of servers) { | 70 | for (const server of servers) { |
71 | const res = await getVideosList(server.url) | 71 | const res = await getVideosList(server.url) |
@@ -102,10 +102,5 @@ describe('Test create transcoding jobs', function () { | |||
102 | 102 | ||
103 | after(async function () { | 103 | after(async function () { |
104 | killallServers(servers) | 104 | killallServers(servers) |
105 | |||
106 | // Keep the logs if the test failed | ||
107 | if (this['ok']) { | ||
108 | await flushTests() | ||
109 | } | ||
110 | }) | 105 | }) |
111 | }) | 106 | }) |