diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-13 10:06:50 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-13 10:22:53 +0200 |
commit | 3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (patch) | |
tree | 9e8622d269919addd35b462141ab5f22236aa6f4 /server/tests/cli/create-import-video-file-job.ts | |
parent | 2186386cca113506791583cb07d6ccacba7af4e0 (diff) | |
download | PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.gz PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.zst PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.zip |
Improve tests when waiting pending jobs
Diffstat (limited to 'server/tests/cli/create-import-video-file-job.ts')
-rw-r--r-- | server/tests/cli/create-import-video-file-job.ts | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts index 1472e60f6..13bcfd209 100644 --- a/server/tests/cli/create-import-video-file-job.ts +++ b/server/tests/cli/create-import-video-file-job.ts | |||
@@ -14,9 +14,9 @@ import { | |||
14 | killallServers, | 14 | killallServers, |
15 | ServerInfo, | 15 | ServerInfo, |
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | uploadVideo, | 17 | uploadVideo |
18 | wait | ||
19 | } from '../utils' | 18 | } from '../utils' |
19 | import { waitJobs } from '../utils/server/jobs' | ||
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
@@ -54,14 +54,14 @@ describe('Test create import video jobs', function () { | |||
54 | video2UUID = res2.body.video.uuid | 54 | video2UUID = res2.body.video.uuid |
55 | 55 | ||
56 | // Transcoding | 56 | // Transcoding |
57 | await wait(40000) | 57 | await waitJobs(servers) |
58 | }) | 58 | }) |
59 | 59 | ||
60 | it('Should run a import job on video 1 with a lower resolution', async function () { | 60 | it('Should run a import job on video 1 with a lower resolution', async function () { |
61 | const env = getEnvCli(servers[0]) | 61 | const env = getEnvCli(servers[0]) |
62 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm`) | 62 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm`) |
63 | 63 | ||
64 | await wait(30000) | 64 | await waitJobs(servers) |
65 | 65 | ||
66 | let magnetUri: string | 66 | let magnetUri: string |
67 | for (const server of servers) { | 67 | for (const server of servers) { |
@@ -85,7 +85,7 @@ describe('Test create import video jobs', function () { | |||
85 | const env = getEnvCli(servers[1]) | 85 | const env = getEnvCli(servers[1]) |
86 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/fixtures/video_short.ogv`) | 86 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/fixtures/video_short.ogv`) |
87 | 87 | ||
88 | await wait(30000) | 88 | await waitJobs(servers) |
89 | 89 | ||
90 | let magnetUri: string | 90 | let magnetUri: string |
91 | for (const server of servers) { | 91 | for (const server of servers) { |
@@ -111,7 +111,7 @@ describe('Test create import video jobs', function () { | |||
111 | const env = getEnvCli(servers[0]) | 111 | const env = getEnvCli(servers[0]) |
112 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short2.webm`) | 112 | await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short2.webm`) |
113 | 113 | ||
114 | await wait(30000) | 114 | await waitJobs(servers) |
115 | 115 | ||
116 | let magnetUri: string | 116 | let magnetUri: string |
117 | for (const server of servers) { | 117 | for (const server of servers) { |
@@ -133,10 +133,5 @@ describe('Test create import video jobs', function () { | |||
133 | 133 | ||
134 | after(async function () { | 134 | after(async function () { |
135 | killallServers(servers) | 135 | killallServers(servers) |
136 | |||
137 | // Keep the logs if the test failed | ||
138 | if (this['ok']) { | ||
139 | await flushTests() | ||
140 | } | ||
141 | }) | 136 | }) |
142 | }) | 137 | }) |