aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/update-host.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-13 10:06:50 +0200
committerChocobozzz <me@florianbigard.com>2018-06-13 10:22:53 +0200
commit3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (patch)
tree9e8622d269919addd35b462141ab5f22236aa6f4 /server/tests/cli/update-host.ts
parent2186386cca113506791583cb07d6ccacba7af4e0 (diff)
downloadPeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.gz
PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.tar.zst
PeerTube-3cd0734fd9b0ff21aaef02317a874e8f1c06e027.zip
Improve tests when waiting pending jobs
Diffstat (limited to 'server/tests/cli/update-host.ts')
-rw-r--r--server/tests/cli/update-host.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts
index ad56f7b1b..d0c6d2042 100644
--- a/server/tests/cli/update-host.ts
+++ b/server/tests/cli/update-host.ts
@@ -3,22 +3,22 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { VideoDetails } from '../../../shared/models/videos' 5import { VideoDetails } from '../../../shared/models/videos'
6const expect = chai.expect
7
8import { 6import {
9 execCLI, 7 execCLI,
10 flushTests, 8 flushTests,
11 getEnvCli, 9 getEnvCli,
10 getVideo,
12 getVideosList, 11 getVideosList,
13 killallServers, 12 killallServers,
14 parseTorrentVideo, 13 parseTorrentVideo,
15 runServer, 14 runServer,
16 ServerInfo, 15 ServerInfo,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 uploadVideo, 17 uploadVideo
19 wait,
20 getVideo
21} from '../utils' 18} from '../utils'
19import { waitJobs } from '../utils/server/jobs'
20
21const expect = chai.expect
22 22
23describe('Test update host scripts', function () { 23describe('Test update host scripts', function () {
24 let server: ServerInfo 24 let server: ServerInfo
@@ -41,7 +41,8 @@ describe('Test update host scripts', function () {
41 const videoAttributes = {} 41 const videoAttributes = {}
42 await uploadVideo(server.url, server.accessToken, videoAttributes) 42 await uploadVideo(server.url, server.accessToken, videoAttributes)
43 await uploadVideo(server.url, server.accessToken, videoAttributes) 43 await uploadVideo(server.url, server.accessToken, videoAttributes)
44 await wait(30000) 44
45 await waitJobs(server)
45 }) 46 })
46 47
47 it('Should update torrent hosts', async function () { 48 it('Should update torrent hosts', async function () {
@@ -82,10 +83,5 @@ describe('Test update host scripts', function () {
82 83
83 after(async function () { 84 after(async function () {
84 killallServers([ server ]) 85 killallServers([ server ])
85
86 // Keep the logs if the test failed
87 if (this['ok']) {
88 await flushTests()
89 }
90 }) 86 })
91}) 87})