aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-24 10:53:40 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:23 +0200
commit210feb6cc484a6c5c63c98f770de34e223f944cb (patch)
treed1d841892a7ac87ac0d434194597606a375aaed1 /server/tests/api/videos
parent9cc8d43e37a61709e7275c2a799bdf976dd940ca (diff)
downloadPeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.gz
PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.zst
PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.zip
Cleanup tests
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/multiple-servers.ts7
-rw-r--r--server/tests/api/videos/services.ts8
-rw-r--r--server/tests/api/videos/single-server.ts13
-rw-r--r--server/tests/api/videos/video-abuse.ts2
-rw-r--r--server/tests/api/videos/video-blacklist.ts2
-rw-r--r--server/tests/api/videos/video-captions.ts4
-rw-r--r--server/tests/api/videos/video-change-ownership.ts18
-rw-r--r--server/tests/api/videos/video-channels.ts4
-rw-r--r--server/tests/api/videos/video-comments.ts8
-rw-r--r--server/tests/api/videos/video-description.ts2
-rw-r--r--server/tests/api/videos/video-hls.ts7
-rw-r--r--server/tests/api/videos/video-imports.ts2
-rw-r--r--server/tests/api/videos/video-nsfw.ts8
-rw-r--r--server/tests/api/videos/video-playlists.ts7
-rw-r--r--server/tests/api/videos/video-privacy.ts2
-rw-r--r--server/tests/api/videos/video-schedule-update.ts2
-rw-r--r--server/tests/api/videos/video-transcoder.ts2
-rw-r--r--server/tests/api/videos/videos-filter.ts9
-rw-r--r--server/tests/api/videos/videos-history.ts13
-rw-r--r--server/tests/api/videos/videos-overview.ts13
-rw-r--r--server/tests/api/videos/videos-views-cleaner.ts11
21 files changed, 42 insertions, 102 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index dd50f905d..50b231555 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -1029,12 +1029,7 @@ describe('Test multiple servers', function () {
1029 }) 1029 })
1030 }) 1030 })
1031 1031
1032 after(async function () { 1032 after(function () {
1033 killallServers(servers) 1033 killallServers(servers)
1034
1035 // Keep the logs if the test failed
1036 if (this['ok']) {
1037 await flushTests()
1038 }
1039 }) 1034 })
1040}) 1035})
diff --git a/server/tests/api/videos/services.ts b/server/tests/api/videos/services.ts
index e79ce59a6..1397347d1 100644
--- a/server/tests/api/videos/services.ts
+++ b/server/tests/api/videos/services.ts
@@ -11,7 +11,7 @@ import {
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 uploadVideo 12 uploadVideo
13} from '../../../../shared/extra-utils/index' 13} from '../../../../shared/extra-utils/index'
14import { runServer } from '../../../../shared/extra-utils/server/servers' 14import { flushAndRunServer } from '../../../../shared/extra-utils/server/servers'
15 15
16const expect = chai.expect 16const expect = chai.expect
17 17
@@ -21,9 +21,7 @@ describe('Test services', function () {
21 before(async function () { 21 before(async function () {
22 this.timeout(30000) 22 this.timeout(30000)
23 23
24 await flushTests() 24 server = await flushAndRunServer(1)
25
26 server = await runServer(1)
27 25
28 await setAccessTokensToServers([ server ]) 26 await setAccessTokensToServers([ server ])
29 27
@@ -76,7 +74,7 @@ describe('Test services', function () {
76 expect(res.body).to.not.have.property('thumbnail_height') 74 expect(res.body).to.not.have.property('thumbnail_height')
77 }) 75 })
78 76
79 after(async function () { 77 after(function () {
80 killallServers([ server ]) 78 killallServers([ server ])
81 }) 79 })
82}) 80})
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts
index ea3e7c421..db2a3779f 100644
--- a/server/tests/api/videos/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -20,7 +20,7 @@ import {
20 killallServers, 20 killallServers,
21 rateVideo, 21 rateVideo,
22 removeVideo, 22 removeVideo,
23 runServer, 23 flushAndRunServer,
24 ServerInfo, 24 ServerInfo,
25 setAccessTokensToServers, 25 setAccessTokensToServers,
26 testImage, 26 testImage,
@@ -107,9 +107,7 @@ describe('Test a single server', function () {
107 before(async function () { 107 before(async function () {
108 this.timeout(30000) 108 this.timeout(30000)
109 109
110 await flushTests() 110 server = await flushAndRunServer(1)
111
112 server = await runServer(1)
113 111
114 await setAccessTokensToServers([ server ]) 112 await setAccessTokensToServers([ server ])
115 }) 113 })
@@ -426,12 +424,7 @@ describe('Test a single server', function () {
426 expect(video.dislikes).to.equal(1) 424 expect(video.dislikes).to.equal(1)
427 }) 425 })
428 426
429 after(async function () { 427 after(function () {
430 killallServers([ server ]) 428 killallServers([ server ])
431
432 // Keep the logs if the test failed
433 if (this['ok']) {
434 await flushTests()
435 }
436 }) 429 })
437}) 430})
diff --git a/server/tests/api/videos/video-abuse.ts b/server/tests/api/videos/video-abuse.ts
index 2ae1bf34d..06bb31348 100644
--- a/server/tests/api/videos/video-abuse.ts
+++ b/server/tests/api/videos/video-abuse.ts
@@ -172,7 +172,7 @@ describe('Test video abuses', function () {
172 expect(res.body.data.length).to.equal(0) 172 expect(res.body.data.length).to.equal(0)
173 }) 173 })
174 174
175 after(async function () { 175 after(function () {
176 killallServers(servers) 176 killallServers(servers)
177 }) 177 })
178}) 178})
diff --git a/server/tests/api/videos/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts
index 582c82e05..cb15d1a52 100644
--- a/server/tests/api/videos/video-blacklist.ts
+++ b/server/tests/api/videos/video-blacklist.ts
@@ -425,7 +425,7 @@ describe('Test video blacklist', function () {
425 }) 425 })
426 }) 426 })
427 427
428 after(async function () { 428 after(function () {
429 killallServers(servers) 429 killallServers(servers)
430 }) 430 })
431}) 431})
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index da920e00c..c6f59762a 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -29,8 +29,6 @@ describe('Test video captions', function () {
29 before(async function () { 29 before(async function () {
30 this.timeout(30000) 30 this.timeout(30000)
31 31
32 await flushTests()
33
34 servers = await flushAndRunMultipleServers(2) 32 servers = await flushAndRunMultipleServers(2)
35 33
36 await setAccessTokensToServers(servers) 34 await setAccessTokensToServers(servers)
@@ -197,7 +195,7 @@ describe('Test video captions', function () {
197 await checkVideoFilesWereRemoved(videoUUID, 1) 195 await checkVideoFilesWereRemoved(videoUUID, 1)
198 }) 196 })
199 197
200 after(async function () { 198 after(function () {
201 killallServers(servers) 199 killallServers(servers)
202 }) 200 })
203}) 201})
diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts
index 9040ac308..db1220677 100644
--- a/server/tests/api/videos/video-change-ownership.ts
+++ b/server/tests/api/videos/video-change-ownership.ts
@@ -5,19 +5,20 @@ import 'mocha'
5import { 5import {
6 acceptChangeOwnership, 6 acceptChangeOwnership,
7 changeVideoOwnership, 7 changeVideoOwnership,
8 createUser, doubleFollow, flushAndRunMultipleServers, 8 createUser,
9 flushTests, 9 doubleFollow,
10 flushAndRunMultipleServers,
11 flushAndRunServer,
10 getMyUserInformation, 12 getMyUserInformation,
13 getVideo,
11 getVideoChangeOwnershipList, 14 getVideoChangeOwnershipList,
12 getVideosList, 15 getVideosList,
13 killallServers, 16 killallServers,
14 refuseChangeOwnership, 17 refuseChangeOwnership,
15 runServer,
16 ServerInfo, 18 ServerInfo,
17 setAccessTokensToServers, 19 setAccessTokensToServers,
18 uploadVideo, 20 uploadVideo,
19 userLogin, 21 userLogin
20 getVideo
21} from '../../../../shared/extra-utils' 22} from '../../../../shared/extra-utils'
22import { waitJobs } from '../../../../shared/extra-utils/server/jobs' 23import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
23import { User } from '../../../../shared/models/users' 24import { User } from '../../../../shared/models/users'
@@ -202,7 +203,7 @@ describe('Test video change ownership - nominal', function () {
202 } 203 }
203 }) 204 })
204 205
205 after(async function () { 206 after(function () {
206 killallServers(servers) 207 killallServers(servers)
207 }) 208 })
208}) 209})
@@ -225,8 +226,7 @@ describe('Test video change ownership - quota too small', function () {
225 this.timeout(50000) 226 this.timeout(50000)
226 227
227 // Run one server 228 // Run one server
228 await flushTests() 229 server = await flushAndRunServer(1)
229 server = await runServer(1)
230 await setAccessTokensToServers([server]) 230 await setAccessTokensToServers([server])
231 231
232 const videoQuota = 42000000 232 const videoQuota = 42000000
@@ -297,7 +297,7 @@ describe('Test video change ownership - quota too small', function () {
297 await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId, 403) 297 await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId, 403)
298 }) 298 })
299 299
300 after(async function () { 300 after(function () {
301 killallServers([server]) 301 killallServers([server])
302 }) 302 })
303}) 303})
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index e30e6bb4f..60b84e443 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -42,8 +42,6 @@ describe('Test video channels', function () {
42 before(async function () { 42 before(async function () {
43 this.timeout(30000) 43 this.timeout(30000)
44 44
45 await flushTests()
46
47 servers = await flushAndRunMultipleServers(2) 45 servers = await flushAndRunMultipleServers(2)
48 46
49 await setAccessTokensToServers(servers) 47 await setAccessTokensToServers(servers)
@@ -279,7 +277,7 @@ describe('Test video channels', function () {
279 } 277 }
280 }) 278 })
281 279
282 after(async function () { 280 after(function () {
283 killallServers(servers) 281 killallServers(servers)
284 }) 282 })
285}) 283})
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts
index abf4d0c44..50224ee47 100644
--- a/server/tests/api/videos/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -8,7 +8,7 @@ import {
8 dateIsValid, 8 dateIsValid,
9 flushTests, 9 flushTests,
10 killallServers, 10 killallServers,
11 runServer, 11 flushAndRunServer,
12 ServerInfo, 12 ServerInfo,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 updateMyAvatar, 14 updateMyAvatar,
@@ -34,9 +34,7 @@ describe('Test video comments', function () {
34 before(async function () { 34 before(async function () {
35 this.timeout(30000) 35 this.timeout(30000)
36 36
37 await flushTests() 37 server = await flushAndRunServer(1)
38
39 server = await runServer(1)
40 38
41 await setAccessTokensToServers([ server ]) 39 await setAccessTokensToServers([ server ])
42 40
@@ -201,7 +199,7 @@ describe('Test video comments', function () {
201 expect(res.body.data[1].totalReplies).to.equal(0) 199 expect(res.body.data[1].totalReplies).to.equal(0)
202 }) 200 })
203 201
204 after(async function () { 202 after(function () {
205 killallServers([ server ]) 203 killallServers([ server ])
206 }) 204 })
207}) 205})
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts
index 0c03d17d8..333d539f4 100644
--- a/server/tests/api/videos/video-description.ts
+++ b/server/tests/api/videos/video-description.ts
@@ -99,7 +99,7 @@ describe('Test video description', function () {
99 } 99 }
100 }) 100 })
101 101
102 after(async function () { 102 after(function () {
103 killallServers(servers) 103 killallServers(servers)
104 }) 104 })
105}) 105})
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index a9251406a..0ac84a656 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -128,12 +128,7 @@ describe('Test HLS videos', function () {
128 } 128 }
129 }) 129 })
130 130
131 after(async function () { 131 after(function () {
132 killallServers(servers) 132 killallServers(servers)
133
134 // Keep the logs if the test failed
135 if (this['ok']) {
136 await flushTests()
137 }
138 }) 133 })
139}) 134})
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts
index f8b2c0407..49a28e207 100644
--- a/server/tests/api/videos/video-imports.ts
+++ b/server/tests/api/videos/video-imports.ts
@@ -241,7 +241,7 @@ describe('Test video imports', function () {
241 } 241 }
242 }) 242 })
243 243
244 after(async function () { 244 after(function () {
245 killallServers(servers) 245 killallServers(servers)
246 }) 246 })
247}) 247})
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts
index 9f2d99ffe..811705212 100644
--- a/server/tests/api/videos/video-nsfw.ts
+++ b/server/tests/api/videos/video-nsfw.ts
@@ -20,7 +20,7 @@ import {
20 getMyUserInformation, 20 getMyUserInformation,
21 getVideoChannelVideos, 21 getVideoChannelVideos,
22 getVideosListWithToken, 22 getVideosListWithToken,
23 runServer, 23 flushAndRunServer,
24 searchVideo, 24 searchVideo,
25 searchVideoWithToken, 25 searchVideoWithToken,
26 updateCustomConfig, 26 updateCustomConfig,
@@ -64,9 +64,7 @@ describe('Test video NSFW policy', function () {
64 64
65 before(async function () { 65 before(async function () {
66 this.timeout(50000) 66 this.timeout(50000)
67 67 server = await flushAndRunServer(1)
68 await flushTests()
69 server = await runServer(1)
70 68
71 // Get the access tokens 69 // Get the access tokens
72 await setAccessTokensToServers([ server ]) 70 await setAccessTokensToServers([ server ])
@@ -243,7 +241,7 @@ describe('Test video NSFW policy', function () {
243 }) 241 })
244 }) 242 })
245 243
246 after(async function () { 244 after(function () {
247 killallServers([ server ]) 245 killallServers([ server ])
248 }) 246 })
249}) 247})
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index 8c3542906..ea349f09b 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -860,12 +860,7 @@ describe('Test video playlists', function () {
860 } 860 }
861 }) 861 })
862 862
863 after(async function () { 863 after(function () {
864 killallServers(servers) 864 killallServers(servers)
865
866 // Keep the logs if the test failed
867 if (this['ok']) {
868 await flushTests()
869 }
870 }) 865 })
871}) 866})
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index ba5e0f044..a823993b2 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -152,7 +152,7 @@ describe('Test video privacy', function () {
152 } 152 }
153 }) 153 })
154 154
155 after(async function () { 155 after(function () {
156 killallServers(servers) 156 killallServers(servers)
157 }) 157 })
158}) 158})
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index b19a9116a..d7301a137 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -165,7 +165,7 @@ describe('Test video update scheduler', function () {
165 } 165 }
166 }) 166 })
167 167
168 after(async function () { 168 after(function () {
169 killallServers(servers) 169 killallServers(servers)
170 }) 170 })
171}) 171})
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 3d4739ca9..92888f137 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -349,7 +349,7 @@ describe('Test video transcoding', function () {
349 } 349 }
350 }) 350 })
351 351
352 after(async function () { 352 after(function () {
353 killallServers(servers) 353 killallServers(servers)
354 }) 354 })
355}) 355})
diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts
index 36664b17f..179610595 100644
--- a/server/tests/api/videos/videos-filter.ts
+++ b/server/tests/api/videos/videos-filter.ts
@@ -55,8 +55,6 @@ describe('Test videos filter validator', function () {
55 before(async function () { 55 before(async function () {
56 this.timeout(120000) 56 this.timeout(120000)
57 57
58 await flushTests()
59
60 servers = await flushAndRunMultipleServers(2) 58 servers = await flushAndRunMultipleServers(2)
61 59
62 await setAccessTokensToServers(servers) 60 await setAccessTokensToServers(servers)
@@ -121,12 +119,7 @@ describe('Test videos filter validator', function () {
121 }) 119 })
122 }) 120 })
123 121
124 after(async function () { 122 after(function () {
125 killallServers(servers) 123 killallServers(servers)
126
127 // Keep the logs if the test failed
128 if (this['ok']) {
129 await flushTests()
130 }
131 }) 124 })
132}) 125})
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts
index 6f75ce42c..2a904c659 100644
--- a/server/tests/api/videos/videos-history.ts
+++ b/server/tests/api/videos/videos-history.ts
@@ -8,7 +8,7 @@ import {
8 getVideosListWithToken, 8 getVideosListWithToken,
9 getVideoWithToken, 9 getVideoWithToken,
10 killallServers, reRunServer, 10 killallServers, reRunServer,
11 runServer, 11 flushAndRunServer,
12 searchVideoWithToken, 12 searchVideoWithToken,
13 ServerInfo, 13 ServerInfo,
14 setAccessTokensToServers, 14 setAccessTokensToServers,
@@ -33,9 +33,7 @@ describe('Test videos history', function () {
33 before(async function () { 33 before(async function () {
34 this.timeout(30000) 34 this.timeout(30000)
35 35
36 await flushTests() 36 server = await flushAndRunServer(1)
37
38 server = await runServer(1)
39 37
40 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
41 39
@@ -222,12 +220,7 @@ describe('Test videos history', function () {
222 expect(res.body.total).to.equal(0) 220 expect(res.body.total).to.equal(0)
223 }) 221 })
224 222
225 after(async function () { 223 after(function () {
226 killallServers([ server ]) 224 killallServers([ server ])
227
228 // Keep the logs if the test failed
229 if (this['ok']) {
230 await flushTests()
231 }
232 }) 225 })
233}) 226})
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts
index 233ca8a5d..c921eb74d 100644
--- a/server/tests/api/videos/videos-overview.ts
+++ b/server/tests/api/videos/videos-overview.ts
@@ -2,7 +2,7 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils' 5import { flushTests, killallServers, flushAndRunServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../../../shared/extra-utils'
6import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews' 6import { getVideosOverview } from '../../../../shared/extra-utils/overviews/overviews'
7import { VideosOverview } from '../../../../shared/models/overviews' 7import { VideosOverview } from '../../../../shared/models/overviews'
8 8
@@ -14,9 +14,7 @@ describe('Test a videos overview', function () {
14 before(async function () { 14 before(async function () {
15 this.timeout(30000) 15 this.timeout(30000)
16 16
17 await flushTests() 17 server = await flushAndRunServer(1)
18
19 server = await runServer(1)
20 18
21 await setAccessTokensToServers([ server ]) 19 await setAccessTokensToServers([ server ])
22 }) 20 })
@@ -89,12 +87,7 @@ describe('Test a videos overview', function () {
89 expect(overview.channels[0].channel.name).to.equal('root_channel') 87 expect(overview.channels[0].channel.name).to.equal('root_channel')
90 }) 88 })
91 89
92 after(async function () { 90 after(function () {
93 killallServers([ server ]) 91 killallServers([ server ])
94
95 // Keep the logs if the test failed
96 if (this['ok']) {
97 await flushTests()
98 }
99 }) 92 })
100}) 93})
diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts
index 4001969c3..80cecdd23 100644
--- a/server/tests/api/videos/videos-views-cleaner.ts
+++ b/server/tests/api/videos/videos-views-cleaner.ts
@@ -7,7 +7,7 @@ import {
7 flushTests, 7 flushTests,
8 killallServers, 8 killallServers,
9 reRunServer, 9 reRunServer,
10 runServer, 10 flushAndRunServer,
11 ServerInfo, 11 ServerInfo,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs 13 uploadVideo, uploadVideoAndGetId, viewVideo, wait, countVideoViewsOf, doubleFollow, waitJobs
@@ -27,8 +27,6 @@ describe('Test video views cleaner', function () {
27 before(async function () { 27 before(async function () {
28 this.timeout(50000) 28 this.timeout(50000)
29 29
30 await flushTests()
31
32 servers = await flushAndRunMultipleServers(2) 30 servers = await flushAndRunMultipleServers(2)
33 await setAccessTokensToServers(servers) 31 await setAccessTokensToServers(servers)
34 32
@@ -102,12 +100,7 @@ describe('Test video views cleaner', function () {
102 } 100 }
103 }) 101 })
104 102
105 after(async function () { 103 after(function () {
106 killallServers(servers) 104 killallServers(servers)
107
108 // Keep the logs if the test failed
109 if (this['ok']) {
110 await flushTests()
111 }
112 }) 105 })
113}) 106})