aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
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/check-params
parent9cc8d43e37a61709e7275c2a799bdf976dd940ca (diff)
downloadPeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.gz
PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.zst
PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.zip
Cleanup tests
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/accounts.ts13
-rw-r--r--server/tests/api/check-params/blocklist.ts9
-rw-r--r--server/tests/api/check-params/config.ts12
-rw-r--r--server/tests/api/check-params/contact-form.ts12
-rw-r--r--server/tests/api/check-params/debug.ts13
-rw-r--r--server/tests/api/check-params/follows.ts12
-rw-r--r--server/tests/api/check-params/jobs.ts13
-rw-r--r--server/tests/api/check-params/logs.ts13
-rw-r--r--server/tests/api/check-params/redundancy.ts8
-rw-r--r--server/tests/api/check-params/search.ts13
-rw-r--r--server/tests/api/check-params/services.ts13
-rw-r--r--server/tests/api/check-params/user-notifications.ts13
-rw-r--r--server/tests/api/check-params/user-subscriptions.ts13
-rw-r--r--server/tests/api/check-params/users.ts15
-rw-r--r--server/tests/api/check-params/video-abuses.ts13
-rw-r--r--server/tests/api/check-params/video-blacklist.ts8
-rw-r--r--server/tests/api/check-params/video-captions.ts13
-rw-r--r--server/tests/api/check-params/video-channels.ts13
-rw-r--r--server/tests/api/check-params/video-comments.ts13
-rw-r--r--server/tests/api/check-params/video-imports.ts13
-rw-r--r--server/tests/api/check-params/video-playlists.ts13
-rw-r--r--server/tests/api/check-params/videos-filter.ts13
-rw-r--r--server/tests/api/check-params/videos-history.ts13
-rw-r--r--server/tests/api/check-params/videos.ts13
24 files changed, 67 insertions, 230 deletions
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index 4c145c41d..086090533 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4 4
5import { flushTests, killallServers, runServer, ServerInfo } from '../../../../shared/extra-utils' 5import { flushTests, killallServers, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
6import { 6import {
7 checkBadCountPagination, 7 checkBadCountPagination,
8 checkBadSortPagination, 8 checkBadSortPagination,
@@ -19,9 +19,7 @@ describe('Test accounts API validators', function () {
19 before(async function () { 19 before(async function () {
20 this.timeout(30000) 20 this.timeout(30000)
21 21
22 await flushTests() 22 server = await flushAndRunServer(1)
23
24 server = await runServer(1)
25 }) 23 })
26 24
27 describe('When listing accounts', function () { 25 describe('When listing accounts', function () {
@@ -44,12 +42,7 @@ describe('Test accounts API validators', function () {
44 }) 42 })
45 }) 43 })
46 44
47 after(async function () { 45 after(function () {
48 killallServers([ server ]) 46 killallServers([ server ])
49
50 // Keep the logs if the test failed
51 if (this['ok']) {
52 await flushTests()
53 }
54 }) 47 })
55}) 48})
diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts
index 6c7351d38..d815a8363 100644
--- a/server/tests/api/check-params/blocklist.ts
+++ b/server/tests/api/check-params/blocklist.ts
@@ -28,8 +28,6 @@ describe('Test blocklist API validators', function () {
28 before(async function () { 28 before(async function () {
29 this.timeout(60000) 29 this.timeout(60000)
30 30
31 await flushTests()
32
33 servers = await flushAndRunMultipleServers(2) 31 servers = await flushAndRunMultipleServers(2)
34 await setAccessTokensToServers(servers) 32 await setAccessTokensToServers(servers)
35 33
@@ -487,12 +485,7 @@ describe('Test blocklist API validators', function () {
487 }) 485 })
488 }) 486 })
489 487
490 after(async function () { 488 after(function () {
491 killallServers(servers) 489 killallServers(servers)
492
493 // Keep the logs if the test failed
494 if (this['ok']) {
495 await flushTests()
496 }
497 }) 490 })
498}) 491})
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index ba07552cf..3d80c629e 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -5,7 +5,7 @@ import 'mocha'
5import { CustomConfig } from '../../../../shared/models/server/custom-config.model' 5import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
6 6
7import { 7import {
8 createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo, 8 createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, flushAndRunServer, ServerInfo,
9 setAccessTokensToServers, userLogin, immutableAssign 9 setAccessTokensToServers, userLogin, immutableAssign
10} from '../../../../shared/extra-utils' 10} from '../../../../shared/extra-utils'
11 11
@@ -101,8 +101,7 @@ describe('Test config API validators', function () {
101 before(async function () { 101 before(async function () {
102 this.timeout(30000) 102 this.timeout(30000)
103 103
104 await flushTests() 104 server = await flushAndRunServer(1)
105 server = await runServer(1)
106 105
107 await setAccessTokensToServers([ server ]) 106 await setAccessTokensToServers([ server ])
108 107
@@ -230,12 +229,7 @@ describe('Test config API validators', function () {
230 }) 229 })
231 }) 230 })
232 231
233 after(async function () { 232 after(function () {
234 killallServers([ server ]) 233 killallServers([ server ])
235
236 // Keep the logs if the test failed
237 if (this['ok']) {
238 await flushTests()
239 }
240 }) 234 })
241}) 235})
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index 9ba6136aa..6c7781f13 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -7,7 +7,7 @@ import {
7 immutableAssign, 7 immutableAssign,
8 killallServers, 8 killallServers,
9 reRunServer, 9 reRunServer,
10 runServer, 10 flushAndRunServer,
11 ServerInfo, 11 ServerInfo,
12 setAccessTokensToServers 12 setAccessTokensToServers
13} from '../../../../shared/extra-utils' 13} from '../../../../shared/extra-utils'
@@ -34,11 +34,10 @@ describe('Test contact form API validators', function () {
34 before(async function () { 34 before(async function () {
35 this.timeout(60000) 35 this.timeout(60000)
36 36
37 await flushTests()
38 await MockSmtpServer.Instance.collectEmails(emails) 37 await MockSmtpServer.Instance.collectEmails(emails)
39 38
40 // Email is disabled 39 // Email is disabled
41 server = await runServer(1) 40 server = await flushAndRunServer(1)
42 }) 41 })
43 42
44 it('Should not accept a contact form if emails are disabled', async function () { 43 it('Should not accept a contact form if emails are disabled', async function () {
@@ -84,13 +83,8 @@ describe('Test contact form API validators', function () {
84 await sendContactForm(immutableAssign(defaultBody, { url: server.url })) 83 await sendContactForm(immutableAssign(defaultBody, { url: server.url }))
85 }) 84 })
86 85
87 after(async function () { 86 after(function () {
88 MockSmtpServer.Instance.kill() 87 MockSmtpServer.Instance.kill()
89 killallServers([ server ]) 88 killallServers([ server ])
90
91 // Keep the logs if the test failed
92 if (this['ok']) {
93 await flushTests()
94 }
95 }) 89 })
96}) 90})
diff --git a/server/tests/api/check-params/debug.ts b/server/tests/api/check-params/debug.ts
index 8ba7e0430..dd00ed9e1 100644
--- a/server/tests/api/check-params/debug.ts
+++ b/server/tests/api/check-params/debug.ts
@@ -6,7 +6,7 @@ import {
6 createUser, 6 createUser,
7 flushTests, 7 flushTests,
8 killallServers, 8 killallServers,
9 runServer, 9 flushAndRunServer,
10 ServerInfo, 10 ServerInfo,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 userLogin 12 userLogin
@@ -23,9 +23,7 @@ describe('Test debug API validators', function () {
23 before(async function () { 23 before(async function () {
24 this.timeout(120000) 24 this.timeout(120000)
25 25
26 await flushTests() 26 server = await flushAndRunServer(1)
27
28 server = await runServer(1)
29 27
30 await setAccessTokensToServers([ server ]) 28 await setAccessTokensToServers([ server ])
31 29
@@ -67,12 +65,7 @@ describe('Test debug API validators', function () {
67 }) 65 })
68 }) 66 })
69 67
70 after(async function () { 68 after(function () {
71 killallServers([ server ]) 69 killallServers([ server ])
72
73 // Keep the logs if the test failed
74 if (this['ok']) {
75 await flushTests()
76 }
77 }) 70 })
78}) 71})
diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts
index e75631312..02f47c2bb 100644
--- a/server/tests/api/check-params/follows.ts
+++ b/server/tests/api/check-params/follows.ts
@@ -3,7 +3,7 @@
3import 'mocha' 3import 'mocha'
4 4
5import { 5import {
6 createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, 6 createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
7 userLogin 7 userLogin
8} from '../../../../shared/extra-utils' 8} from '../../../../shared/extra-utils'
9import { 9import {
@@ -20,8 +20,7 @@ describe('Test server follows API validators', function () {
20 before(async function () { 20 before(async function () {
21 this.timeout(30000) 21 this.timeout(30000)
22 22
23 await flushTests() 23 server = await flushAndRunServer(1)
24 server = await runServer(1)
25 24
26 await setAccessTokensToServers([ server ]) 25 await setAccessTokensToServers([ server ])
27 }) 26 })
@@ -296,12 +295,7 @@ describe('Test server follows API validators', function () {
296 }) 295 })
297 }) 296 })
298 297
299 after(async function () { 298 after(function () {
300 killallServers([ server ]) 299 killallServers([ server ])
301
302 // Keep the logs if the test failed
303 if (this['ok']) {
304 await flushTests()
305 }
306 }) 300 })
307}) 301})
diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.ts
index 682406e87..ec2be0b9f 100644
--- a/server/tests/api/check-params/jobs.ts
+++ b/server/tests/api/check-params/jobs.ts
@@ -6,7 +6,7 @@ import {
6 createUser, 6 createUser,
7 flushTests, 7 flushTests,
8 killallServers, 8 killallServers,
9 runServer, 9 flushAndRunServer,
10 ServerInfo, 10 ServerInfo,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 userLogin 12 userLogin
@@ -28,9 +28,7 @@ describe('Test jobs API validators', function () {
28 before(async function () { 28 before(async function () {
29 this.timeout(120000) 29 this.timeout(120000)
30 30
31 await flushTests() 31 server = await flushAndRunServer(1)
32
33 server = await runServer(1)
34 32
35 await setAccessTokensToServers([ server ]) 33 await setAccessTokensToServers([ server ])
36 34
@@ -82,12 +80,7 @@ describe('Test jobs API validators', function () {
82 }) 80 })
83 }) 81 })
84 82
85 after(async function () { 83 after(function () {
86 killallServers([ server ]) 84 killallServers([ server ])
87
88 // Keep the logs if the test failed
89 if (this['ok']) {
90 await flushTests()
91 }
92 }) 85 })
93}) 86})
diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts
index 0948f7c5e..46cb2392d 100644
--- a/server/tests/api/check-params/logs.ts
+++ b/server/tests/api/check-params/logs.ts
@@ -6,7 +6,7 @@ import {
6 createUser, 6 createUser,
7 flushTests, 7 flushTests,
8 killallServers, 8 killallServers,
9 runServer, 9 flushAndRunServer,
10 ServerInfo, 10 ServerInfo,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 userLogin 12 userLogin
@@ -23,9 +23,7 @@ describe('Test logs API validators', function () {
23 before(async function () { 23 before(async function () {
24 this.timeout(120000) 24 this.timeout(120000)
25 25
26 await flushTests() 26 server = await flushAndRunServer(1)
27
28 server = await runServer(1)
29 27
30 await setAccessTokensToServers([ server ]) 28 await setAccessTokensToServers([ server ])
31 29
@@ -106,12 +104,7 @@ describe('Test logs API validators', function () {
106 }) 104 })
107 }) 105 })
108 106
109 after(async function () { 107 after(function () {
110 killallServers([ server ]) 108 killallServers([ server ])
111
112 // Keep the logs if the test failed
113 if (this['ok']) {
114 await flushTests()
115 }
116 }) 109 })
117}) 110})
diff --git a/server/tests/api/check-params/redundancy.ts b/server/tests/api/check-params/redundancy.ts
index 93b905fea..8f930fbbc 100644
--- a/server/tests/api/check-params/redundancy.ts
+++ b/server/tests/api/check-params/redundancy.ts
@@ -23,7 +23,6 @@ describe('Test server redundancy API validators', function () {
23 before(async function () { 23 before(async function () {
24 this.timeout(30000) 24 this.timeout(30000)
25 25
26 await flushTests()
27 servers = await flushAndRunMultipleServers(2) 26 servers = await flushAndRunMultipleServers(2)
28 27
29 await setAccessTokensToServers(servers) 28 await setAccessTokensToServers(servers)
@@ -92,12 +91,7 @@ describe('Test server redundancy API validators', function () {
92 }) 91 })
93 }) 92 })
94 93
95 after(async function () { 94 after(function () {
96 killallServers(servers) 95 killallServers(servers)
97
98 // Keep the logs if the test failed
99 if (this['ok']) {
100 await flushTests()
101 }
102 }) 96 })
103}) 97})
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts
index 1fcdedd90..816719779 100644
--- a/server/tests/api/check-params/search.ts
+++ b/server/tests/api/check-params/search.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4 4
5import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/extra-utils' 5import { flushTests, immutableAssign, killallServers, makeGetRequest, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
6import { 6import {
7 checkBadCountPagination, 7 checkBadCountPagination,
8 checkBadSortPagination, 8 checkBadSortPagination,
@@ -17,9 +17,7 @@ describe('Test videos API validator', function () {
17 before(async function () { 17 before(async function () {
18 this.timeout(30000) 18 this.timeout(30000)
19 19
20 await flushTests() 20 server = await flushAndRunServer(1)
21
22 server = await runServer(1)
23 }) 21 })
24 22
25 describe('When searching videos', function () { 23 describe('When searching videos', function () {
@@ -146,12 +144,7 @@ describe('Test videos API validator', function () {
146 }) 144 })
147 }) 145 })
148 146
149 after(async function () { 147 after(function () {
150 killallServers([ server ]) 148 killallServers([ server ])
151
152 // Keep the logs if the test failed
153 if (this['ok']) {
154 await flushTests()
155 }
156 }) 149 })
157}) 150})
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 813bc7e36..33580ddb1 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -6,7 +6,7 @@ import {
6 flushTests, 6 flushTests,
7 killallServers, 7 killallServers,
8 makeGetRequest, 8 makeGetRequest,
9 runServer, 9 flushAndRunServer,
10 ServerInfo, 10 ServerInfo,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 uploadVideo 12 uploadVideo
@@ -20,9 +20,7 @@ describe('Test services API validators', function () {
20 before(async function () { 20 before(async function () {
21 this.timeout(60000) 21 this.timeout(60000)
22 22
23 await flushTests() 23 server = await flushAndRunServer(1)
24
25 server = await runServer(1)
26 await setAccessTokensToServers([ server ]) 24 await setAccessTokensToServers([ server ])
27 25
28 const res = await uploadVideo(server.url, server.accessToken, { name: 'my super name' }) 26 const res = await uploadVideo(server.url, server.accessToken, { name: 'my super name' })
@@ -93,13 +91,8 @@ describe('Test services API validators', function () {
93 }) 91 })
94 }) 92 })
95 93
96 after(async function () { 94 after(function () {
97 killallServers([ server ]) 95 killallServers([ server ])
98
99 // Keep the logs if the test failed
100 if (this['ok']) {
101 await flushTests()
102 }
103 }) 96 })
104}) 97})
105 98
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index c56328406..32619d7e1 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -10,7 +10,7 @@ import {
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 makePutBodyRequest, 12 makePutBodyRequest,
13 runServer, 13 flushAndRunServer,
14 ServerInfo, 14 ServerInfo,
15 setAccessTokensToServers, 15 setAccessTokensToServers,
16 wait 16 wait
@@ -30,9 +30,7 @@ describe('Test user notifications API validators', function () {
30 before(async function () { 30 before(async function () {
31 this.timeout(30000) 31 this.timeout(30000)
32 32
33 await flushTests() 33 server = await flushAndRunServer(1)
34
35 server = await runServer(1)
36 34
37 await setAccessTokensToServers([ server ]) 35 await setAccessTokensToServers([ server ])
38 }) 36 })
@@ -288,12 +286,7 @@ describe('Test user notifications API validators', function () {
288 }) 286 })
289 }) 287 })
290 288
291 after(async function () { 289 after(function () {
292 killallServers([ server ]) 290 killallServers([ server ])
293
294 // Keep the logs if the test failed
295 if (this['ok']) {
296 await flushTests()
297 }
298 }) 291 })
299}) 292})
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts
index d33b3bca6..1fe67fa7c 100644
--- a/server/tests/api/check-params/user-subscriptions.ts
+++ b/server/tests/api/check-params/user-subscriptions.ts
@@ -9,7 +9,7 @@ import {
9 makeDeleteRequest, 9 makeDeleteRequest,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 runServer, 12 flushAndRunServer,
13 ServerInfo, 13 ServerInfo,
14 setAccessTokensToServers, 14 setAccessTokensToServers,
15 userLogin 15 userLogin
@@ -32,9 +32,7 @@ describe('Test user subscriptions API validators', function () {
32 before(async function () { 32 before(async function () {
33 this.timeout(30000) 33 this.timeout(30000)
34 34
35 await flushTests() 35 server = await flushAndRunServer(1)
36
37 server = await runServer(1)
38 36
39 await setAccessTokensToServers([ server ]) 37 await setAccessTokensToServers([ server ])
40 38
@@ -303,12 +301,7 @@ describe('Test user subscriptions API validators', function () {
303 }) 301 })
304 }) 302 })
305 303
306 after(async function () { 304 after(function () {
307 killallServers([ server ]) 305 killallServers([ server ])
308
309 // Keep the logs if the test failed
310 if (this['ok']) {
311 await flushTests()
312 }
313 }) 306 })
314}) 307})
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index b62806554..00d0a7e2b 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -7,7 +7,7 @@ import { UserRole, VideoImport, VideoImportState } from '../../../../shared'
7 7
8import { 8import {
9 createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest, 9 createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
10 makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers, 10 makePostBodyRequest, makeUploadRequest, makePutBodyRequest, registerUser, removeUser, flushAndRunServer, ServerInfo, setAccessTokensToServers,
11 updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser 11 updateUser, uploadVideo, userLogin, deleteMe, unblockUser, blockUser
12} from '../../../../shared/extra-utils' 12} from '../../../../shared/extra-utils'
13import { 13import {
@@ -40,10 +40,8 @@ describe('Test users API validators', function () {
40 before(async function () { 40 before(async function () {
41 this.timeout(30000) 41 this.timeout(30000)
42 42
43 await flushTests() 43 server = await flushAndRunServer(1)
44 44 serverWithRegistrationDisabled = await flushAndRunServer(2)
45 server = await runServer(1)
46 serverWithRegistrationDisabled = await runServer(2)
47 45
48 await setAccessTokensToServers([ server ]) 46 await setAccessTokensToServers([ server ])
49 47
@@ -881,12 +879,7 @@ describe('Test users API validators', function () {
881 }) 879 })
882 }) 880 })
883 881
884 after(async function () { 882 after(function () {
885 killallServers([ server, serverWithRegistrationDisabled ]) 883 killallServers([ server, serverWithRegistrationDisabled ])
886
887 // Keep the logs if the test failed
888 if (this['ok']) {
889 await flushTests()
890 }
891 }) 884 })
892}) 885})
diff --git a/server/tests/api/check-params/video-abuses.ts b/server/tests/api/check-params/video-abuses.ts
index 78e4acf2f..e2813d470 100644
--- a/server/tests/api/check-params/video-abuses.ts
+++ b/server/tests/api/check-params/video-abuses.ts
@@ -9,7 +9,7 @@ import {
9 killallServers, 9 killallServers,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 runServer, 12 flushAndRunServer,
13 ServerInfo, 13 ServerInfo,
14 setAccessTokensToServers, 14 setAccessTokensToServers,
15 updateVideoAbuse, 15 updateVideoAbuse,
@@ -33,9 +33,7 @@ describe('Test video abuses API validators', 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
@@ -190,12 +188,7 @@ describe('Test video abuses API validators', function () {
190 }) 188 })
191 }) 189 })
192 190
193 after(async function () { 191 after(function () {
194 killallServers([ server ]) 192 killallServers([ server ])
195
196 // Keep the logs if the test failed
197 if (this['ok']) {
198 await flushTests()
199 }
200 }) 193 })
201}) 194})
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index c2e9622cc..f9c7d9e9a 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -39,7 +39,6 @@ describe('Test video blacklist API validators', function () {
39 before(async function () { 39 before(async function () {
40 this.timeout(120000) 40 this.timeout(120000)
41 41
42 await flushTests()
43 servers = await flushAndRunMultipleServers(2) 42 servers = await flushAndRunMultipleServers(2)
44 43
45 await setAccessTokensToServers(servers) 44 await setAccessTokensToServers(servers)
@@ -248,12 +247,7 @@ describe('Test video blacklist API validators', function () {
248 }) 247 })
249 }) 248 })
250 249
251 after(async function () { 250 after(function () {
252 killallServers(servers) 251 killallServers(servers)
253
254 // Keep the logs if the test failed
255 if (this['ok']) {
256 await flushTests()
257 }
258 }) 252 })
259}) 253})
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index 4ef5e03ed..64265865a 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -8,7 +8,7 @@ import {
8 makeDeleteRequest, 8 makeDeleteRequest,
9 makeGetRequest, 9 makeGetRequest,
10 makeUploadRequest, 10 makeUploadRequest,
11 runServer, 11 flushAndRunServer,
12 ServerInfo, 12 ServerInfo,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 uploadVideo, 14 uploadVideo,
@@ -29,9 +29,7 @@ describe('Test video captions API validator', function () {
29 before(async function () { 29 before(async function () {
30 this.timeout(30000) 30 this.timeout(30000)
31 31
32 await flushTests() 32 server = await flushAndRunServer(1)
33
34 server = await runServer(1)
35 33
36 await setAccessTokensToServers([ server ]) 34 await setAccessTokensToServers([ server ])
37 35
@@ -271,12 +269,7 @@ describe('Test video captions API validator', function () {
271 }) 269 })
272 }) 270 })
273 271
274 after(async function () { 272 after(function () {
275 killallServers([ server ]) 273 killallServers([ server ])
276
277 // Keep the logs if the test failed
278 if (this['ok']) {
279 await flushTests()
280 }
281 }) 274 })
282}) 275})
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index b6aa745ab..06da4f541 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -16,7 +16,7 @@ import {
16 makePostBodyRequest, 16 makePostBodyRequest,
17 makePutBodyRequest, 17 makePutBodyRequest,
18 makeUploadRequest, 18 makeUploadRequest,
19 runServer, 19 flushAndRunServer,
20 ServerInfo, 20 ServerInfo,
21 setAccessTokensToServers, 21 setAccessTokensToServers,
22 userLogin 22 userLogin
@@ -41,9 +41,7 @@ describe('Test video channels API validator', function () {
41 before(async function () { 41 before(async function () {
42 this.timeout(30000) 42 this.timeout(30000)
43 43
44 await flushTests() 44 server = await flushAndRunServer(1)
45
46 server = await runServer(1)
47 45
48 await setAccessTokensToServers([ server ]) 46 await setAccessTokensToServers([ server ])
49 47
@@ -312,12 +310,7 @@ describe('Test video channels API validator', function () {
312 }) 310 })
313 }) 311 })
314 312
315 after(async function () { 313 after(function () {
316 killallServers([ server ]) 314 killallServers([ server ])
317
318 // Keep the logs if the test failed
319 if (this['ok']) {
320 await flushTests()
321 }
322 }) 315 })
323}) 316})
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index b80d91279..bb14abbfd 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -4,7 +4,7 @@ import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { 5import {
6 createUser, 6 createUser,
7 flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, 7 flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
8 uploadVideo, userLogin 8 uploadVideo, userLogin
9} from '../../../../shared/extra-utils' 9} from '../../../../shared/extra-utils'
10import { 10import {
@@ -29,9 +29,7 @@ describe('Test video comments API validator', function () {
29 before(async function () { 29 before(async function () {
30 this.timeout(30000) 30 this.timeout(30000)
31 31
32 await flushTests() 32 server = await flushAndRunServer(1)
33
34 server = await runServer(1)
35 33
36 await setAccessTokensToServers([ server ]) 34 await setAccessTokensToServers([ server ])
37 35
@@ -253,12 +251,7 @@ describe('Test video comments API validator', function () {
253 it('Should return conflict on comment thread add') 251 it('Should return conflict on comment thread add')
254 }) 252 })
255 253
256 after(async function () { 254 after(function () {
257 killallServers([ server ]) 255 killallServers([ server ])
258
259 // Keep the logs if the test failed
260 if (this['ok']) {
261 await flushTests()
262 }
263 }) 256 })
264}) 257})
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index ad4c4def0..82fdc0667 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -13,7 +13,7 @@ import {
13 makeGetRequest, 13 makeGetRequest,
14 makePostBodyRequest, 14 makePostBodyRequest,
15 makeUploadRequest, 15 makeUploadRequest,
16 runServer, 16 flushAndRunServer,
17 ServerInfo, 17 ServerInfo,
18 setAccessTokensToServers, 18 setAccessTokensToServers,
19 updateCustomSubConfig, 19 updateCustomSubConfig,
@@ -38,9 +38,7 @@ describe('Test video imports API validator', function () {
38 before(async function () { 38 before(async function () {
39 this.timeout(30000) 39 this.timeout(30000)
40 40
41 await flushTests() 41 server = await flushAndRunServer(1)
42
43 server = await runServer(1)
44 42
45 await setAccessTokensToServers([ server ]) 43 await setAccessTokensToServers([ server ])
46 44
@@ -313,12 +311,7 @@ describe('Test video imports API validator', function () {
313 }) 311 })
314 }) 312 })
315 313
316 after(async function () { 314 after(function () {
317 killallServers([ server ]) 315 killallServers([ server ])
318
319 // Keep the logs if the test failed
320 if (this['ok']) {
321 await flushTests()
322 }
323 }) 316 })
324}) 317})
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts
index 0f3484763..0edb51682 100644
--- a/server/tests/api/check-params/video-playlists.ts
+++ b/server/tests/api/check-params/video-playlists.ts
@@ -14,7 +14,7 @@ import {
14 makeGetRequest, 14 makeGetRequest,
15 removeVideoFromPlaylist, 15 removeVideoFromPlaylist,
16 reorderVideosPlaylist, 16 reorderVideosPlaylist,
17 runServer, 17 flushAndRunServer,
18 ServerInfo, 18 ServerInfo,
19 setAccessTokensToServers, setDefaultVideoChannel, 19 setAccessTokensToServers, setDefaultVideoChannel,
20 updateVideoPlaylist, 20 updateVideoPlaylist,
@@ -43,9 +43,7 @@ describe('Test video playlists API validator', function () {
43 before(async function () { 43 before(async function () {
44 this.timeout(30000) 44 this.timeout(30000)
45 45
46 await flushTests() 46 server = await flushAndRunServer(1)
47
48 server = await runServer(1)
49 47
50 await setAccessTokensToServers([ server ]) 48 await setAccessTokensToServers([ server ])
51 await setDefaultVideoChannel([ server ]) 49 await setDefaultVideoChannel([ server ])
@@ -670,12 +668,7 @@ describe('Test video playlists API validator', function () {
670 }) 668 })
671 }) 669 })
672 670
673 after(async function () { 671 after(function () {
674 killallServers([ server ]) 672 killallServers([ server ])
675
676 // Keep the logs if the test failed
677 if (this['ok']) {
678 await flushTests()
679 }
680 }) 673 })
681}) 674})
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts
index 971867b27..82cc0f638 100644
--- a/server/tests/api/check-params/videos-filter.ts
+++ b/server/tests/api/check-params/videos-filter.ts
@@ -7,7 +7,7 @@ import {
7 flushTests, 7 flushTests,
8 killallServers, 8 killallServers,
9 makeGetRequest, 9 makeGetRequest,
10 runServer, 10 flushAndRunServer,
11 ServerInfo, 11 ServerInfo,
12 setAccessTokensToServers, setDefaultVideoChannel, 12 setAccessTokensToServers, setDefaultVideoChannel,
13 userLogin 13 userLogin
@@ -48,9 +48,7 @@ describe('Test videos filters', function () {
48 before(async function () { 48 before(async function () {
49 this.timeout(30000) 49 this.timeout(30000)
50 50
51 await flushTests() 51 server = await flushAndRunServer(1)
52
53 server = await runServer(1)
54 52
55 await setAccessTokensToServers([ server ]) 53 await setAccessTokensToServers([ server ])
56 await setDefaultVideoChannel([ server ]) 54 await setDefaultVideoChannel([ server ])
@@ -131,12 +129,7 @@ describe('Test videos filters', function () {
131 }) 129 })
132 }) 130 })
133 131
134 after(async function () { 132 after(function () {
135 killallServers([ server ]) 133 killallServers([ server ])
136
137 // Keep the logs if the test failed
138 if (this['ok']) {
139 await flushTests()
140 }
141 }) 134 })
142}) 135})
diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts
index 11e277644..32f65f510 100644
--- a/server/tests/api/check-params/videos-history.ts
+++ b/server/tests/api/check-params/videos-history.ts
@@ -10,7 +10,7 @@ import {
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 makePutBodyRequest, 12 makePutBodyRequest,
13 runServer, 13 flushAndRunServer,
14 ServerInfo, 14 ServerInfo,
15 setAccessTokensToServers, 15 setAccessTokensToServers,
16 uploadVideo 16 uploadVideo
@@ -29,9 +29,7 @@ describe('Test videos history API validator', function () {
29 before(async function () { 29 before(async function () {
30 this.timeout(30000) 30 this.timeout(30000)
31 31
32 await flushTests() 32 server = await flushAndRunServer(1)
33
34 server = await runServer(1)
35 33
36 await setAccessTokensToServers([ server ]) 34 await setAccessTokensToServers([ server ])
37 35
@@ -128,12 +126,7 @@ describe('Test videos history API validator', function () {
128 }) 126 })
129 }) 127 })
130 128
131 after(async function () { 129 after(function () {
132 killallServers([ server ]) 130 killallServers([ server ])
133
134 // Keep the logs if the test failed
135 if (this['ok']) {
136 await flushTests()
137 }
138 }) 131 })
139}) 132})
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index e96f324cc..bc321e91f 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -8,7 +8,7 @@ import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enu
8import { 8import {
9 createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest, 9 createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
10 makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo, 10 makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo,
11 runServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig 11 flushAndRunServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig
12} from '../../../../shared/extra-utils' 12} from '../../../../shared/extra-utils'
13import { 13import {
14 checkBadCountPagination, 14 checkBadCountPagination,
@@ -33,9 +33,7 @@ describe('Test videos API validator', 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
@@ -730,12 +728,7 @@ describe('Test videos API validator', function () {
730 }) 728 })
731 }) 729 })
732 730
733 after(async function () { 731 after(function () {
734 killallServers([ server ]) 732 killallServers([ server ])
735
736 // Keep the logs if the test failed
737 if (this['ok']) {
738 await flushTests()
739 }
740 }) 733 })
741}) 734})