aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-privacy.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/api/videos/video-privacy.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/api/videos/video-privacy.ts')
-rw-r--r--server/tests/api/videos/video-privacy.ts16
1 files changed, 5 insertions, 11 deletions
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index ea435d5af..9fefca7e3 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -5,18 +5,17 @@ import 'mocha'
5import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' 5import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
6import { 6import {
7 flushAndRunMultipleServers, 7 flushAndRunMultipleServers,
8 flushTests,
9 getVideosList, 8 getVideosList,
10 killallServers, 9 killallServers,
11 ServerInfo, 10 ServerInfo,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 uploadVideo, 12 uploadVideo
14 wait
15} from '../../utils/index' 13} from '../../utils/index'
16import { doubleFollow } from '../../utils/server/follows' 14import { doubleFollow } from '../../utils/server/follows'
17import { userLogin } from '../../utils/users/login' 15import { userLogin } from '../../utils/users/login'
18import { createUser } from '../../utils/users/users' 16import { createUser } from '../../utils/users/users'
19import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos' 17import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos'
18import { waitJobs } from '../../utils/server/jobs'
20 19
21const expect = chai.expect 20const expect = chai.expect
22 21
@@ -48,7 +47,7 @@ describe('Test video privacy', function () {
48 } 47 }
49 await uploadVideo(servers[0].url, servers[0].accessToken, attributes) 48 await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
50 49
51 await wait(5000) 50 await waitJobs(servers)
52 }) 51 })
53 52
54 it('Should not have this private video on server 2', async function () { 53 it('Should not have this private video on server 2', async function () {
@@ -99,7 +98,7 @@ describe('Test video privacy', function () {
99 await uploadVideo(servers[1].url, servers[1].accessToken, attributes) 98 await uploadVideo(servers[1].url, servers[1].accessToken, attributes)
100 99
101 // Server 2 has transcoding enabled 100 // Server 2 has transcoding enabled
102 await wait(10000) 101 await waitJobs(servers)
103 }) 102 })
104 103
105 it('Should not have this unlisted video listed on server 1 and 2', async function () { 104 it('Should not have this unlisted video listed on server 1 and 2', async function () {
@@ -139,7 +138,7 @@ describe('Test video privacy', function () {
139 now = Date.now() 138 now = Date.now()
140 await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute) 139 await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, attribute)
141 140
142 await wait(5000) 141 await waitJobs(servers)
143 }) 142 })
144 143
145 it('Should have this new public video listed on server 1 and 2', async function () { 144 it('Should have this new public video listed on server 1 and 2', async function () {
@@ -155,10 +154,5 @@ describe('Test video privacy', function () {
155 154
156 after(async function () { 155 after(async function () {
157 killallServers(servers) 156 killallServers(servers)
158
159 // Keep the logs if the test failed
160 if (this['ok']) {
161 await flushTests()
162 }
163 }) 157 })
164}) 158})