aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/abuses.ts12
-rw-r--r--server/tests/api/check-params/accounts.ts8
-rw-r--r--server/tests/api/check-params/blocklist.ts10
-rw-r--r--server/tests/api/check-params/bulk.ts8
-rw-r--r--server/tests/api/check-params/config.ts8
-rw-r--r--server/tests/api/check-params/contact-form.ts10
-rw-r--r--server/tests/api/check-params/custom-pages.ts8
-rw-r--r--server/tests/api/check-params/debug.ts8
-rw-r--r--server/tests/api/check-params/follows.ts8
-rw-r--r--server/tests/api/check-params/jobs.ts8
-rw-r--r--server/tests/api/check-params/live.ts8
-rw-r--r--server/tests/api/check-params/logs.ts8
-rw-r--r--server/tests/api/check-params/plugins.ts8
-rw-r--r--server/tests/api/check-params/redundancy.ts8
-rw-r--r--server/tests/api/check-params/search.ts10
-rw-r--r--server/tests/api/check-params/services.ts10
-rw-r--r--server/tests/api/check-params/upload-quota.ts8
-rw-r--r--server/tests/api/check-params/user-notifications.ts8
-rw-r--r--server/tests/api/check-params/user-subscriptions.ts8
-rw-r--r--server/tests/api/check-params/users.ts15
-rw-r--r--server/tests/api/check-params/video-blacklist.ts8
-rw-r--r--server/tests/api/check-params/video-captions.ts8
-rw-r--r--server/tests/api/check-params/video-channels.ts8
-rw-r--r--server/tests/api/check-params/video-comments.ts8
-rw-r--r--server/tests/api/check-params/video-imports.ts8
-rw-r--r--server/tests/api/check-params/video-playlists.ts8
-rw-r--r--server/tests/api/check-params/videos-filter.ts10
-rw-r--r--server/tests/api/check-params/videos-history.ts8
-rw-r--r--server/tests/api/check-params/videos-overviews.ts6
-rw-r--r--server/tests/api/check-params/videos.ts8
30 files changed, 129 insertions, 130 deletions
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts
index 7a6790ba8..62811f932 100644
--- a/server/tests/api/check-params/abuses.ts
+++ b/server/tests/api/check-params/abuses.ts
@@ -9,10 +9,10 @@ import {
9 checkBadStartPagination, 9 checkBadStartPagination,
10 cleanupTests, 10 cleanupTests,
11 doubleFollow, 11 doubleFollow,
12 flushAndRunServer, 12 createSingleServer,
13 makeGetRequest, 13 makeGetRequest,
14 makePostBodyRequest, 14 makePostBodyRequest,
15 ServerInfo, 15 PeerTubeServer,
16 setAccessTokensToServers, 16 setAccessTokensToServers,
17 waitJobs 17 waitJobs
18} from '@shared/extra-utils' 18} from '@shared/extra-utils'
@@ -21,7 +21,7 @@ import { AbuseCreate, AbuseState } from '@shared/models'
21describe('Test abuses API validators', function () { 21describe('Test abuses API validators', function () {
22 const basePath = '/api/v1/abuses/' 22 const basePath = '/api/v1/abuses/'
23 23
24 let server: ServerInfo 24 let server: PeerTubeServer
25 25
26 let userToken = '' 26 let userToken = ''
27 let userToken2 = '' 27 let userToken2 = ''
@@ -35,7 +35,7 @@ describe('Test abuses API validators', function () {
35 before(async function () { 35 before(async function () {
36 this.timeout(30000) 36 this.timeout(30000)
37 37
38 server = await flushAndRunServer(1) 38 server = await createSingleServer(1)
39 39
40 await setAccessTokensToServers([ server ]) 40 await setAccessTokensToServers([ server ])
41 41
@@ -404,12 +404,12 @@ describe('Test abuses API validators', function () {
404 404
405 describe('When trying to manage messages of a remote abuse', function () { 405 describe('When trying to manage messages of a remote abuse', function () {
406 let remoteAbuseId: number 406 let remoteAbuseId: number
407 let anotherServer: ServerInfo 407 let anotherServer: PeerTubeServer
408 408
409 before(async function () { 409 before(async function () {
410 this.timeout(50000) 410 this.timeout(50000)
411 411
412 anotherServer = await flushAndRunServer(2) 412 anotherServer = await createSingleServer(2)
413 await setAccessTokensToServers([ anotherServer ]) 413 await setAccessTokensToServers([ anotherServer ])
414 414
415 await doubleFollow(anotherServer, server) 415 await doubleFollow(anotherServer, server)
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index 223322626..e866593db 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -7,20 +7,20 @@ import {
7 checkBadSortPagination, 7 checkBadSortPagination,
8 checkBadStartPagination, 8 checkBadStartPagination,
9 cleanupTests, 9 cleanupTests,
10 flushAndRunServer, 10 createSingleServer,
11 ServerInfo 11 PeerTubeServer
12} from '@shared/extra-utils' 12} from '@shared/extra-utils'
13 13
14describe('Test accounts API validators', function () { 14describe('Test accounts API validators', function () {
15 const path = '/api/v1/accounts/' 15 const path = '/api/v1/accounts/'
16 let server: ServerInfo 16 let server: PeerTubeServer
17 17
18 // --------------------------------------------------------------- 18 // ---------------------------------------------------------------
19 19
20 before(async function () { 20 before(async function () {
21 this.timeout(30000) 21 this.timeout(30000)
22 22
23 server = await flushAndRunServer(1) 23 server = await createSingleServer(1)
24 }) 24 })
25 25
26 describe('When listing accounts', function () { 26 describe('When listing accounts', function () {
diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts
index 14e45e503..b2a1cc4e2 100644
--- a/server/tests/api/check-params/blocklist.ts
+++ b/server/tests/api/check-params/blocklist.ts
@@ -5,11 +5,11 @@ import 'mocha'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow, 7 doubleFollow,
8 flushAndRunMultipleServers, 8 createMultipleServers,
9 makeDeleteRequest, 9 makeDeleteRequest,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 ServerInfo, 12 PeerTubeServer,
13 setAccessTokensToServers 13 setAccessTokensToServers
14} from '../../../../shared/extra-utils' 14} from '../../../../shared/extra-utils'
15import { 15import {
@@ -20,14 +20,14 @@ import {
20import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 20import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
21 21
22describe('Test blocklist API validators', function () { 22describe('Test blocklist API validators', function () {
23 let servers: ServerInfo[] 23 let servers: PeerTubeServer[]
24 let server: ServerInfo 24 let server: PeerTubeServer
25 let userAccessToken: string 25 let userAccessToken: string
26 26
27 before(async function () { 27 before(async function () {
28 this.timeout(60000) 28 this.timeout(60000)
29 29
30 servers = await flushAndRunMultipleServers(2) 30 servers = await createMultipleServers(2)
31 await setAccessTokensToServers(servers) 31 await setAccessTokensToServers(servers)
32 32
33 server = servers[0] 33 server = servers[0]
diff --git a/server/tests/api/check-params/bulk.ts b/server/tests/api/check-params/bulk.ts
index 69ff7dd96..a660c3d80 100644
--- a/server/tests/api/check-params/bulk.ts
+++ b/server/tests/api/check-params/bulk.ts
@@ -3,15 +3,15 @@
3import 'mocha' 3import 'mocha'
4import { 4import {
5 cleanupTests, 5 cleanupTests,
6 flushAndRunServer, 6 createSingleServer,
7 ServerInfo, 7 PeerTubeServer,
8 setAccessTokensToServers 8 setAccessTokensToServers
9} from '../../../../shared/extra-utils' 9} from '../../../../shared/extra-utils'
10import { makePostBodyRequest } from '../../../../shared/extra-utils/requests/requests' 10import { makePostBodyRequest } from '../../../../shared/extra-utils/requests/requests'
11import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 11import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
12 12
13describe('Test bulk API validators', function () { 13describe('Test bulk API validators', function () {
14 let server: ServerInfo 14 let server: PeerTubeServer
15 let userAccessToken: string 15 let userAccessToken: string
16 16
17 // --------------------------------------------------------------- 17 // ---------------------------------------------------------------
@@ -19,7 +19,7 @@ describe('Test bulk API validators', function () {
19 before(async function () { 19 before(async function () {
20 this.timeout(120000) 20 this.timeout(120000)
21 21
22 server = await flushAndRunServer(1) 22 server = await createSingleServer(1)
23 await setAccessTokensToServers([ server ]) 23 await setAccessTokensToServers([ server ])
24 24
25 const user = { username: 'user1', password: 'password' } 25 const user = { username: 'user1', password: 'password' }
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index 6fd26864e..1756d58ee 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -5,18 +5,18 @@ import { omit } from 'lodash'
5import { HttpStatusCode } from '@shared/core-utils' 5import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 flushAndRunServer, 8 createSingleServer,
9 makeDeleteRequest, 9 makeDeleteRequest,
10 makeGetRequest, 10 makeGetRequest,
11 makePutBodyRequest, 11 makePutBodyRequest,
12 ServerInfo, 12 PeerTubeServer,
13 setAccessTokensToServers 13 setAccessTokensToServers
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { CustomConfig } from '@shared/models' 15import { CustomConfig } from '@shared/models'
16 16
17describe('Test config API validators', function () { 17describe('Test config API validators', function () {
18 const path = '/api/v1/config/custom' 18 const path = '/api/v1/config/custom'
19 let server: ServerInfo 19 let server: PeerTubeServer
20 let userAccessToken: string 20 let userAccessToken: string
21 const updateParams: CustomConfig = { 21 const updateParams: CustomConfig = {
22 instance: { 22 instance: {
@@ -197,7 +197,7 @@ describe('Test config API validators', function () {
197 before(async function () { 197 before(async function () {
198 this.timeout(30000) 198 this.timeout(30000)
199 199
200 server = await flushAndRunServer(1) 200 server = await createSingleServer(1)
201 201
202 await setAccessTokensToServers([ server ]) 202 await setAccessTokensToServers([ server ])
203 203
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index d2541777f..8c2b2a84b 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -2,11 +2,11 @@
2 2
3import 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/core-utils' 4import { HttpStatusCode } from '@shared/core-utils'
5import { cleanupTests, flushAndRunServer, killallServers, MockSmtpServer, reRunServer, ServerInfo } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils'
6import { ContactFormCommand } from '@shared/extra-utils/server' 6import { ContactFormCommand } from '@shared/extra-utils/server'
7 7
8describe('Test contact form API validators', function () { 8describe('Test contact form API validators', function () {
9 let server: ServerInfo 9 let server: PeerTubeServer
10 const emails: object[] = [] 10 const emails: object[] = []
11 const defaultBody = { 11 const defaultBody = {
12 fromName: 'super name', 12 fromName: 'super name',
@@ -25,7 +25,7 @@ describe('Test contact form API validators', function () {
25 emailPort = await MockSmtpServer.Instance.collectEmails(emails) 25 emailPort = await MockSmtpServer.Instance.collectEmails(emails)
26 26
27 // Email is disabled 27 // Email is disabled
28 server = await flushAndRunServer(1) 28 server = await createSingleServer(1)
29 command = server.contactForm 29 command = server.contactForm
30 }) 30 })
31 31
@@ -39,7 +39,7 @@ describe('Test contact form API validators', function () {
39 await killallServers([ server ]) 39 await killallServers([ server ])
40 40
41 // Contact form is disabled 41 // Contact form is disabled
42 await reRunServer(server, { smtp: { hostname: 'localhost', port: emailPort }, contact_form: { enabled: false } }) 42 await server.run({ smtp: { hostname: 'localhost', port: emailPort }, contact_form: { enabled: false } })
43 await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 }) 43 await command.send({ ...defaultBody, expectedStatus: HttpStatusCode.CONFLICT_409 })
44 }) 44 })
45 45
@@ -49,7 +49,7 @@ describe('Test contact form API validators', function () {
49 await killallServers([ server ]) 49 await killallServers([ server ])
50 50
51 // Email & contact form enabled 51 // Email & contact form enabled
52 await reRunServer(server, { smtp: { hostname: 'localhost', port: emailPort } }) 52 await server.run({ smtp: { hostname: 'localhost', port: emailPort } })
53 53
54 await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 54 await command.send({ ...defaultBody, fromEmail: 'badEmail', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
55 await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 55 await command.send({ ...defaultBody, fromEmail: 'badEmail@', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
diff --git a/server/tests/api/check-params/custom-pages.ts b/server/tests/api/check-params/custom-pages.ts
index 3d84fb3e6..043505e32 100644
--- a/server/tests/api/check-params/custom-pages.ts
+++ b/server/tests/api/check-params/custom-pages.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 4import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 ServerInfo, 8 PeerTubeServer,
9 setAccessTokensToServers 9 setAccessTokensToServers
10} from '../../../../shared/extra-utils' 10} from '../../../../shared/extra-utils'
11import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-utils/requests/requests' 11import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-utils/requests/requests'
@@ -13,7 +13,7 @@ import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-uti
13describe('Test custom pages validators', function () { 13describe('Test custom pages validators', function () {
14 const path = '/api/v1/custom-pages/homepage/instance' 14 const path = '/api/v1/custom-pages/homepage/instance'
15 15
16 let server: ServerInfo 16 let server: PeerTubeServer
17 let userAccessToken: string 17 let userAccessToken: string
18 18
19 // --------------------------------------------------------------- 19 // ---------------------------------------------------------------
@@ -21,7 +21,7 @@ describe('Test custom pages validators', function () {
21 before(async function () { 21 before(async function () {
22 this.timeout(120000) 22 this.timeout(120000)
23 23
24 server = await flushAndRunServer(1) 24 server = await createSingleServer(1)
25 await setAccessTokensToServers([ server ]) 25 await setAccessTokensToServers([ server ])
26 26
27 const user = { username: 'user1', password: 'password' } 27 const user = { username: 'user1', password: 'password' }
diff --git a/server/tests/api/check-params/debug.ts b/server/tests/api/check-params/debug.ts
index 609f9566e..9c13e9daf 100644
--- a/server/tests/api/check-params/debug.ts
+++ b/server/tests/api/check-params/debug.ts
@@ -4,8 +4,8 @@ import 'mocha'
4 4
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 ServerInfo, 8 PeerTubeServer,
9 setAccessTokensToServers 9 setAccessTokensToServers
10} from '../../../../shared/extra-utils' 10} from '../../../../shared/extra-utils'
11import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' 11import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
@@ -13,7 +13,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c
13 13
14describe('Test debug API validators', function () { 14describe('Test debug API validators', function () {
15 const path = '/api/v1/server/debug' 15 const path = '/api/v1/server/debug'
16 let server: ServerInfo 16 let server: PeerTubeServer
17 let userAccessToken = '' 17 let userAccessToken = ''
18 18
19 // --------------------------------------------------------------- 19 // ---------------------------------------------------------------
@@ -21,7 +21,7 @@ describe('Test debug API validators', function () {
21 before(async function () { 21 before(async function () {
22 this.timeout(120000) 22 this.timeout(120000)
23 23
24 server = await flushAndRunServer(1) 24 server = await createSingleServer(1)
25 25
26 await setAccessTokensToServers([ server ]) 26 await setAccessTokensToServers([ server ])
27 27
diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts
index fae3712ce..0fd2b4925 100644
--- a/server/tests/api/check-params/follows.ts
+++ b/server/tests/api/check-params/follows.ts
@@ -4,10 +4,10 @@ import 'mocha'
4 4
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 makeDeleteRequest, makeGetRequest, 8 makeDeleteRequest, makeGetRequest,
9 makePostBodyRequest, 9 makePostBodyRequest,
10 ServerInfo, 10 PeerTubeServer,
11 setAccessTokensToServers 11 setAccessTokensToServers
12} from '../../../../shared/extra-utils' 12} from '../../../../shared/extra-utils'
13import { 13import {
@@ -18,14 +18,14 @@ import {
18import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 18import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
19 19
20describe('Test server follows API validators', function () { 20describe('Test server follows API validators', function () {
21 let server: ServerInfo 21 let server: PeerTubeServer
22 22
23 // --------------------------------------------------------------- 23 // ---------------------------------------------------------------
24 24
25 before(async function () { 25 before(async function () {
26 this.timeout(30000) 26 this.timeout(30000)
27 27
28 server = await flushAndRunServer(1) 28 server = await createSingleServer(1)
29 29
30 await setAccessTokensToServers([ server ]) 30 await setAccessTokensToServers([ server ])
31 }) 31 })
diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.ts
index 3786e8612..a370ec2d3 100644
--- a/server/tests/api/check-params/jobs.ts
+++ b/server/tests/api/check-params/jobs.ts
@@ -4,8 +4,8 @@ import 'mocha'
4 4
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 ServerInfo, 8 PeerTubeServer,
9 setAccessTokensToServers 9 setAccessTokensToServers
10} from '../../../../shared/extra-utils' 10} from '../../../../shared/extra-utils'
11import { 11import {
@@ -18,7 +18,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c
18 18
19describe('Test jobs API validators', function () { 19describe('Test jobs API validators', function () {
20 const path = '/api/v1/jobs/failed' 20 const path = '/api/v1/jobs/failed'
21 let server: ServerInfo 21 let server: PeerTubeServer
22 let userAccessToken = '' 22 let userAccessToken = ''
23 23
24 // --------------------------------------------------------------- 24 // ---------------------------------------------------------------
@@ -26,7 +26,7 @@ describe('Test jobs API validators', function () {
26 before(async function () { 26 before(async function () {
27 this.timeout(120000) 27 this.timeout(120000)
28 28
29 server = await flushAndRunServer(1) 29 server = await createSingleServer(1)
30 30
31 await setAccessTokensToServers([ server ]) 31 await setAccessTokensToServers([ server ])
32 32
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 20f27dd1d..eb5cdd1d8 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -6,12 +6,12 @@ import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 buildAbsoluteFixturePath, 7 buildAbsoluteFixturePath,
8 cleanupTests, 8 cleanupTests,
9 flushAndRunServer, 9 createSingleServer,
10 LiveCommand, 10 LiveCommand,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 makeUploadRequest, 12 makeUploadRequest,
13 sendRTMPStream, 13 sendRTMPStream,
14 ServerInfo, 14 PeerTubeServer,
15 setAccessTokensToServers, 15 setAccessTokensToServers,
16 stopFfmpeg 16 stopFfmpeg
17} from '@shared/extra-utils' 17} from '@shared/extra-utils'
@@ -19,7 +19,7 @@ import { VideoCreateResult, VideoPrivacy } from '@shared/models'
19 19
20describe('Test video lives API validator', function () { 20describe('Test video lives API validator', function () {
21 const path = '/api/v1/videos/live' 21 const path = '/api/v1/videos/live'
22 let server: ServerInfo 22 let server: PeerTubeServer
23 let userAccessToken = '' 23 let userAccessToken = ''
24 let channelId: number 24 let channelId: number
25 let video: VideoCreateResult 25 let video: VideoCreateResult
@@ -31,7 +31,7 @@ describe('Test video lives API validator', function () {
31 before(async function () { 31 before(async function () {
32 this.timeout(30000) 32 this.timeout(30000)
33 33
34 server = await flushAndRunServer(1) 34 server = await createSingleServer(1)
35 35
36 await setAccessTokensToServers([ server ]) 36 await setAccessTokensToServers([ server ])
37 37
diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts
index cf8f77959..2eb074007 100644
--- a/server/tests/api/check-params/logs.ts
+++ b/server/tests/api/check-params/logs.ts
@@ -4,8 +4,8 @@ import 'mocha'
4 4
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 ServerInfo, 8 PeerTubeServer,
9 setAccessTokensToServers 9 setAccessTokensToServers
10} from '../../../../shared/extra-utils' 10} from '../../../../shared/extra-utils'
11import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' 11import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
@@ -13,7 +13,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c
13 13
14describe('Test logs API validators', function () { 14describe('Test logs API validators', function () {
15 const path = '/api/v1/server/logs' 15 const path = '/api/v1/server/logs'
16 let server: ServerInfo 16 let server: PeerTubeServer
17 let userAccessToken = '' 17 let userAccessToken = ''
18 18
19 // --------------------------------------------------------------- 19 // ---------------------------------------------------------------
@@ -21,7 +21,7 @@ describe('Test logs API validators', function () {
21 before(async function () { 21 before(async function () {
22 this.timeout(120000) 22 this.timeout(120000)
23 23
24 server = await flushAndRunServer(1) 24 server = await createSingleServer(1)
25 25
26 await setAccessTokensToServers([ server ]) 26 await setAccessTokensToServers([ server ])
27 27
diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts
index d4b72c0f4..2b471ee7d 100644
--- a/server/tests/api/check-params/plugins.ts
+++ b/server/tests/api/check-params/plugins.ts
@@ -7,17 +7,17 @@ import {
7 checkBadSortPagination, 7 checkBadSortPagination,
8 checkBadStartPagination, 8 checkBadStartPagination,
9 cleanupTests, 9 cleanupTests,
10 flushAndRunServer, 10 createSingleServer,
11 makeGetRequest, 11 makeGetRequest,
12 makePostBodyRequest, 12 makePostBodyRequest,
13 makePutBodyRequest, 13 makePutBodyRequest,
14 ServerInfo, 14 PeerTubeServer,
15 setAccessTokensToServers 15 setAccessTokensToServers
16} from '@shared/extra-utils' 16} from '@shared/extra-utils'
17import { PeerTubePlugin, PluginType } from '@shared/models' 17import { PeerTubePlugin, PluginType } from '@shared/models'
18 18
19describe('Test server plugins API validators', function () { 19describe('Test server plugins API validators', function () {
20 let server: ServerInfo 20 let server: PeerTubeServer
21 let userAccessToken = null 21 let userAccessToken = null
22 22
23 const npmPlugin = 'peertube-plugin-hello-world' 23 const npmPlugin = 'peertube-plugin-hello-world'
@@ -33,7 +33,7 @@ describe('Test server plugins API validators', function () {
33 before(async function () { 33 before(async function () {
34 this.timeout(30000) 34 this.timeout(30000)
35 35
36 server = await flushAndRunServer(1) 36 server = await createSingleServer(1)
37 37
38 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
39 39
diff --git a/server/tests/api/check-params/redundancy.ts b/server/tests/api/check-params/redundancy.ts
index fca92fde4..18b98a0f9 100644
--- a/server/tests/api/check-params/redundancy.ts
+++ b/server/tests/api/check-params/redundancy.ts
@@ -9,18 +9,18 @@ import {
9 checkBadStartPagination, 9 checkBadStartPagination,
10 cleanupTests, 10 cleanupTests,
11 doubleFollow, 11 doubleFollow,
12 flushAndRunMultipleServers, 12 createMultipleServers,
13 makeDeleteRequest, 13 makeDeleteRequest,
14 makeGetRequest, 14 makeGetRequest,
15 makePostBodyRequest, 15 makePostBodyRequest,
16 makePutBodyRequest, 16 makePutBodyRequest,
17 ServerInfo, 17 PeerTubeServer,
18 setAccessTokensToServers, 18 setAccessTokensToServers,
19 waitJobs 19 waitJobs
20} from '../../../../shared/extra-utils' 20} from '../../../../shared/extra-utils'
21 21
22describe('Test server redundancy API validators', function () { 22describe('Test server redundancy API validators', function () {
23 let servers: ServerInfo[] 23 let servers: PeerTubeServer[]
24 let userAccessToken = null 24 let userAccessToken = null
25 let videoIdLocal: number 25 let videoIdLocal: number
26 let videoRemote: VideoCreateResult 26 let videoRemote: VideoCreateResult
@@ -30,7 +30,7 @@ describe('Test server redundancy API validators', function () {
30 before(async function () { 30 before(async function () {
31 this.timeout(80000) 31 this.timeout(80000)
32 32
33 servers = await flushAndRunMultipleServers(2) 33 servers = await createMultipleServers(2)
34 34
35 await setAccessTokensToServers(servers) 35 await setAccessTokensToServers(servers)
36 await doubleFollow(servers[0], servers[1]) 36 await doubleFollow(servers[0], servers[1])
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts
index 1acfa0922..43cd81af9 100644
--- a/server/tests/api/check-params/search.ts
+++ b/server/tests/api/check-params/search.ts
@@ -7,13 +7,13 @@ import {
7 checkBadSortPagination, 7 checkBadSortPagination,
8 checkBadStartPagination, 8 checkBadStartPagination,
9 cleanupTests, 9 cleanupTests,
10 flushAndRunServer, 10 createSingleServer,
11 makeGetRequest, 11 makeGetRequest,
12 ServerInfo, 12 PeerTubeServer,
13 setAccessTokensToServers 13 setAccessTokensToServers
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15 15
16function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSearch = false) { 16function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
17 return server.config.updateCustomSubConfig({ 17 return server.config.updateCustomSubConfig({
18 newConfig: { 18 newConfig: {
19 search: { 19 search: {
@@ -27,14 +27,14 @@ function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSe
27} 27}
28 28
29describe('Test videos API validator', function () { 29describe('Test videos API validator', function () {
30 let server: ServerInfo 30 let server: PeerTubeServer
31 31
32 // --------------------------------------------------------------- 32 // ---------------------------------------------------------------
33 33
34 before(async function () { 34 before(async function () {
35 this.timeout(30000) 35 this.timeout(30000)
36 36
37 server = await flushAndRunServer(1) 37 server = await createSingleServer(1)
38 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
39 }) 39 })
40 40
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 83435c24a..c623240b7 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -4,16 +4,16 @@ import 'mocha'
4import { HttpStatusCode } from '@shared/core-utils' 4import { HttpStatusCode } from '@shared/core-utils'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 makeGetRequest, 8 makeGetRequest,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel 11 setDefaultVideoChannel
12} from '@shared/extra-utils' 12} from '@shared/extra-utils'
13import { VideoPlaylistPrivacy } from '@shared/models' 13import { VideoPlaylistPrivacy } from '@shared/models'
14 14
15describe('Test services API validators', function () { 15describe('Test services API validators', function () {
16 let server: ServerInfo 16 let server: PeerTubeServer
17 let playlistUUID: string 17 let playlistUUID: string
18 18
19 // --------------------------------------------------------------- 19 // ---------------------------------------------------------------
@@ -21,7 +21,7 @@ describe('Test services API validators', function () {
21 before(async function () { 21 before(async function () {
22 this.timeout(60000) 22 this.timeout(60000)
23 23
24 server = await flushAndRunServer(1) 24 server = await createSingleServer(1)
25 await setAccessTokensToServers([ server ]) 25 await setAccessTokensToServers([ server ])
26 await setDefaultVideoChannel([ server ]) 26 await setDefaultVideoChannel([ server ])
27 27
@@ -120,7 +120,7 @@ describe('Test services API validators', function () {
120 }) 120 })
121}) 121})
122 122
123function checkParamEmbed (server: ServerInfo, embedUrl: string, statusCodeExpected = HttpStatusCode.BAD_REQUEST_400, query = {}) { 123function checkParamEmbed (server: PeerTubeServer, embedUrl: string, statusCodeExpected = HttpStatusCode.BAD_REQUEST_400, query = {}) {
124 const path = '/services/oembed' 124 const path = '/services/oembed'
125 125
126 return makeGetRequest({ 126 return makeGetRequest({
diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.ts
index 4ca544790..2c73e6a19 100644
--- a/server/tests/api/check-params/upload-quota.ts
+++ b/server/tests/api/check-params/upload-quota.ts
@@ -5,9 +5,9 @@ import { expect } from 'chai'
5import { HttpStatusCode, randomInt } from '@shared/core-utils' 5import { HttpStatusCode, randomInt } from '@shared/core-utils'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 flushAndRunServer, 8 createSingleServer,
9 ImportsCommand, 9 ImportsCommand,
10 ServerInfo, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 setDefaultVideoChannel, 12 setDefaultVideoChannel,
13 VideosCommand, 13 VideosCommand,
@@ -16,7 +16,7 @@ import {
16import { VideoImportState, VideoPrivacy } from '@shared/models' 16import { VideoImportState, VideoPrivacy } from '@shared/models'
17 17
18describe('Test upload quota', function () { 18describe('Test upload quota', function () {
19 let server: ServerInfo 19 let server: PeerTubeServer
20 let rootId: number 20 let rootId: number
21 let command: VideosCommand 21 let command: VideosCommand
22 22
@@ -25,7 +25,7 @@ describe('Test upload quota', function () {
25 before(async function () { 25 before(async function () {
26 this.timeout(30000) 26 this.timeout(30000)
27 27
28 server = await flushAndRunServer(1) 28 server = await createSingleServer(1)
29 await setAccessTokensToServers([ server ]) 29 await setAccessTokensToServers([ server ])
30 await setDefaultVideoChannel([ server ]) 30 await setDefaultVideoChannel([ server ])
31 31
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 913eca366..038c444b3 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -8,25 +8,25 @@ import {
8 checkBadSortPagination, 8 checkBadSortPagination,
9 checkBadStartPagination, 9 checkBadStartPagination,
10 cleanupTests, 10 cleanupTests,
11 flushAndRunServer, 11 createSingleServer,
12 makeGetRequest, 12 makeGetRequest,
13 makePostBodyRequest, 13 makePostBodyRequest,
14 makePutBodyRequest, 14 makePutBodyRequest,
15 ServerInfo, 15 PeerTubeServer,
16 setAccessTokensToServers, 16 setAccessTokensToServers,
17 wait 17 wait
18} from '@shared/extra-utils' 18} from '@shared/extra-utils'
19import { UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' 19import { UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
20 20
21describe('Test user notifications API validators', function () { 21describe('Test user notifications API validators', function () {
22 let server: ServerInfo 22 let server: PeerTubeServer
23 23
24 // --------------------------------------------------------------- 24 // ---------------------------------------------------------------
25 25
26 before(async function () { 26 before(async function () {
27 this.timeout(30000) 27 this.timeout(30000)
28 28
29 server = await flushAndRunServer(1) 29 server = await createSingleServer(1)
30 30
31 await setAccessTokensToServers([ server ]) 31 await setAccessTokensToServers([ server ])
32 }) 32 })
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts
index 885ad68e4..22cf130c2 100644
--- a/server/tests/api/check-params/user-subscriptions.ts
+++ b/server/tests/api/check-params/user-subscriptions.ts
@@ -4,11 +4,11 @@ import 'mocha'
4 4
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 makeDeleteRequest, 8 makeDeleteRequest,
9 makeGetRequest, 9 makeGetRequest,
10 makePostBodyRequest, 10 makePostBodyRequest,
11 ServerInfo, 11 PeerTubeServer,
12 setAccessTokensToServers 12 setAccessTokensToServers
13} from '../../../../shared/extra-utils' 13} from '../../../../shared/extra-utils'
14 14
@@ -22,7 +22,7 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c
22 22
23describe('Test user subscriptions API validators', function () { 23describe('Test user subscriptions API validators', function () {
24 const path = '/api/v1/users/me/subscriptions' 24 const path = '/api/v1/users/me/subscriptions'
25 let server: ServerInfo 25 let server: PeerTubeServer
26 let userAccessToken = '' 26 let userAccessToken = ''
27 27
28 // --------------------------------------------------------------- 28 // ---------------------------------------------------------------
@@ -30,7 +30,7 @@ describe('Test user subscriptions API validators', function () {
30 before(async function () { 30 before(async function () {
31 this.timeout(30000) 31 this.timeout(30000)
32 32
33 server = await flushAndRunServer(1) 33 server = await createSingleServer(1)
34 34
35 await setAccessTokensToServers([ server ]) 35 await setAccessTokensToServers([ server ])
36 36
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index bce3f0774..c2c98f429 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -9,15 +9,14 @@ import {
9 checkBadSortPagination, 9 checkBadSortPagination,
10 checkBadStartPagination, 10 checkBadStartPagination,
11 cleanupTests, 11 cleanupTests,
12 flushAndRunServer, 12 createSingleServer,
13 killallServers, 13 killallServers,
14 makeGetRequest, 14 makeGetRequest,
15 makePostBodyRequest, 15 makePostBodyRequest,
16 makePutBodyRequest, 16 makePutBodyRequest,
17 makeUploadRequest, 17 makeUploadRequest,
18 MockSmtpServer, 18 MockSmtpServer,
19 reRunServer, 19 PeerTubeServer,
20 ServerInfo,
21 setAccessTokensToServers, 20 setAccessTokensToServers,
22 UsersCommand 21 UsersCommand
23} from '@shared/extra-utils' 22} from '@shared/extra-utils'
@@ -29,8 +28,8 @@ describe('Test users API validators', function () {
29 let rootId: number 28 let rootId: number
30 let moderatorId: number 29 let moderatorId: number
31 let video: VideoCreateResult 30 let video: VideoCreateResult
32 let server: ServerInfo 31 let server: PeerTubeServer
33 let serverWithRegistrationDisabled: ServerInfo 32 let serverWithRegistrationDisabled: PeerTubeServer
34 let userToken = '' 33 let userToken = ''
35 let moderatorToken = '' 34 let moderatorToken = ''
36 let emailPort: number 35 let emailPort: number
@@ -48,8 +47,8 @@ describe('Test users API validators', function () {
48 47
49 { 48 {
50 const res = await Promise.all([ 49 const res = await Promise.all([
51 flushAndRunServer(1, overrideConfig), 50 createSingleServer(1, overrideConfig),
52 flushAndRunServer(2) 51 createSingleServer(2)
53 ]) 52 ])
54 53
55 server = res[0] 54 server = res[0]
@@ -196,7 +195,7 @@ describe('Test users API validators', function () {
196 port: emailPort 195 port: emailPort
197 } 196 }
198 } 197 }
199 await reRunServer(server, config) 198 await server.run(config)
200 199
201 const fields = { 200 const fields = {
202 ...baseCorrectParams, 201 ...baseCorrectParams,
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index 51609b982..b5d0e0778 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -10,17 +10,17 @@ import {
10 checkBadStartPagination, 10 checkBadStartPagination,
11 cleanupTests, 11 cleanupTests,
12 doubleFollow, 12 doubleFollow,
13 flushAndRunMultipleServers, 13 createMultipleServers,
14 makePostBodyRequest, 14 makePostBodyRequest,
15 makePutBodyRequest, 15 makePutBodyRequest,
16 ServerInfo, 16 PeerTubeServer,
17 setAccessTokensToServers, 17 setAccessTokensToServers,
18 waitJobs 18 waitJobs
19} from '@shared/extra-utils' 19} from '@shared/extra-utils'
20import { VideoBlacklistType } from '@shared/models' 20import { VideoBlacklistType } from '@shared/models'
21 21
22describe('Test video blacklist API validators', function () { 22describe('Test video blacklist API validators', function () {
23 let servers: ServerInfo[] 23 let servers: PeerTubeServer[]
24 let notBlacklistedVideoId: string 24 let notBlacklistedVideoId: string
25 let remoteVideoUUID: string 25 let remoteVideoUUID: string
26 let userAccessToken1 = '' 26 let userAccessToken1 = ''
@@ -32,7 +32,7 @@ describe('Test video blacklist API validators', function () {
32 before(async function () { 32 before(async function () {
33 this.timeout(120000) 33 this.timeout(120000)
34 34
35 servers = await flushAndRunMultipleServers(2) 35 servers = await createMultipleServers(2)
36 36
37 await setAccessTokensToServers(servers) 37 await setAccessTokensToServers(servers)
38 await doubleFollow(servers[0], servers[1]) 38 await doubleFollow(servers[0], servers[1])
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index 913f894b9..26aab79e7 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -5,11 +5,11 @@ import { HttpStatusCode } from '@shared/core-utils'
5import { 5import {
6 buildAbsoluteFixturePath, 6 buildAbsoluteFixturePath,
7 cleanupTests, 7 cleanupTests,
8 flushAndRunServer, 8 createSingleServer,
9 makeDeleteRequest, 9 makeDeleteRequest,
10 makeGetRequest, 10 makeGetRequest,
11 makeUploadRequest, 11 makeUploadRequest,
12 ServerInfo, 12 PeerTubeServer,
13 setAccessTokensToServers 13 setAccessTokensToServers
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { VideoCreateResult } from '@shared/models' 15import { VideoCreateResult } from '@shared/models'
@@ -17,7 +17,7 @@ import { VideoCreateResult } from '@shared/models'
17describe('Test video captions API validator', function () { 17describe('Test video captions API validator', function () {
18 const path = '/api/v1/videos/' 18 const path = '/api/v1/videos/'
19 19
20 let server: ServerInfo 20 let server: PeerTubeServer
21 let userAccessToken: string 21 let userAccessToken: string
22 let video: VideoCreateResult 22 let video: VideoCreateResult
23 23
@@ -26,7 +26,7 @@ describe('Test video captions API validator', function () {
26 before(async function () { 26 before(async function () {
27 this.timeout(30000) 27 this.timeout(30000)
28 28
29 server = await flushAndRunServer(1) 29 server = await createSingleServer(1)
30 30
31 await setAccessTokensToServers([ server ]) 31 await setAccessTokensToServers([ server ])
32 32
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 8e6e32f20..62b8fa4f6 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -11,12 +11,12 @@ import {
11 checkBadSortPagination, 11 checkBadSortPagination,
12 checkBadStartPagination, 12 checkBadStartPagination,
13 cleanupTests, 13 cleanupTests,
14 flushAndRunServer, 14 createSingleServer,
15 makeGetRequest, 15 makeGetRequest,
16 makePostBodyRequest, 16 makePostBodyRequest,
17 makePutBodyRequest, 17 makePutBodyRequest,
18 makeUploadRequest, 18 makeUploadRequest,
19 ServerInfo, 19 PeerTubeServer,
20 setAccessTokensToServers 20 setAccessTokensToServers
21} from '@shared/extra-utils' 21} from '@shared/extra-utils'
22import { VideoChannelUpdate } from '@shared/models' 22import { VideoChannelUpdate } from '@shared/models'
@@ -25,7 +25,7 @@ const expect = chai.expect
25 25
26describe('Test video channels API validator', function () { 26describe('Test video channels API validator', function () {
27 const videoChannelPath = '/api/v1/video-channels' 27 const videoChannelPath = '/api/v1/video-channels'
28 let server: ServerInfo 28 let server: PeerTubeServer
29 let accessTokenUser: string 29 let accessTokenUser: string
30 let command: ChannelsCommand 30 let command: ChannelsCommand
31 31
@@ -34,7 +34,7 @@ describe('Test video channels API validator', function () {
34 before(async function () { 34 before(async function () {
35 this.timeout(30000) 35 this.timeout(30000)
36 36
37 server = await flushAndRunServer(1) 37 server = await createSingleServer(1)
38 38
39 await setAccessTokensToServers([ server ]) 39 await setAccessTokensToServers([ server ])
40 40
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index 44af9d7e3..ea5340b40 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -8,11 +8,11 @@ import {
8 checkBadSortPagination, 8 checkBadSortPagination,
9 checkBadStartPagination, 9 checkBadStartPagination,
10 cleanupTests, 10 cleanupTests,
11 flushAndRunServer, 11 createSingleServer,
12 makeDeleteRequest, 12 makeDeleteRequest,
13 makeGetRequest, 13 makeGetRequest,
14 makePostBodyRequest, 14 makePostBodyRequest,
15 ServerInfo, 15 PeerTubeServer,
16 setAccessTokensToServers 16 setAccessTokensToServers
17} from '@shared/extra-utils' 17} from '@shared/extra-utils'
18import { VideoCreateResult } from '@shared/models' 18import { VideoCreateResult } from '@shared/models'
@@ -22,7 +22,7 @@ const expect = chai.expect
22describe('Test video comments API validator', function () { 22describe('Test video comments API validator', function () {
23 let pathThread: string 23 let pathThread: string
24 let pathComment: string 24 let pathComment: string
25 let server: ServerInfo 25 let server: PeerTubeServer
26 let video: VideoCreateResult 26 let video: VideoCreateResult
27 let userAccessToken: string 27 let userAccessToken: string
28 let userAccessToken2: string 28 let userAccessToken2: string
@@ -33,7 +33,7 @@ describe('Test video comments API validator', function () {
33 before(async function () { 33 before(async function () {
34 this.timeout(30000) 34 this.timeout(30000)
35 35
36 server = await flushAndRunServer(1) 36 server = await createSingleServer(1)
37 37
38 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
39 39
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index 1a6b6075f..627f0c7ad 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -9,19 +9,19 @@ import {
9 checkBadSortPagination, 9 checkBadSortPagination,
10 checkBadStartPagination, 10 checkBadStartPagination,
11 cleanupTests, 11 cleanupTests,
12 flushAndRunServer, 12 createSingleServer,
13 ImportsCommand, 13 ImportsCommand,
14 makeGetRequest, 14 makeGetRequest,
15 makePostBodyRequest, 15 makePostBodyRequest,
16 makeUploadRequest, 16 makeUploadRequest,
17 ServerInfo, 17 PeerTubeServer,
18 setAccessTokensToServers 18 setAccessTokensToServers
19} from '@shared/extra-utils' 19} from '@shared/extra-utils'
20import { VideoPrivacy } from '@shared/models' 20import { VideoPrivacy } from '@shared/models'
21 21
22describe('Test video imports API validator', function () { 22describe('Test video imports API validator', function () {
23 const path = '/api/v1/videos/imports' 23 const path = '/api/v1/videos/imports'
24 let server: ServerInfo 24 let server: PeerTubeServer
25 let userAccessToken = '' 25 let userAccessToken = ''
26 let channelId: number 26 let channelId: number
27 27
@@ -30,7 +30,7 @@ describe('Test video imports API validator', function () {
30 before(async function () { 30 before(async function () {
31 this.timeout(30000) 31 this.timeout(30000)
32 32
33 server = await flushAndRunServer(1) 33 server = await createSingleServer(1)
34 34
35 await setAccessTokensToServers([ server ]) 35 await setAccessTokensToServers([ server ])
36 36
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts
index e0e42ebb0..9d054b176 100644
--- a/server/tests/api/check-params/video-playlists.ts
+++ b/server/tests/api/check-params/video-playlists.ts
@@ -7,10 +7,10 @@ import {
7 checkBadSortPagination, 7 checkBadSortPagination,
8 checkBadStartPagination, 8 checkBadStartPagination,
9 cleanupTests, 9 cleanupTests,
10 flushAndRunServer, 10 createSingleServer,
11 makeGetRequest, 11 makeGetRequest,
12 PlaylistsCommand, 12 PlaylistsCommand,
13 ServerInfo, 13 PeerTubeServer,
14 setAccessTokensToServers, 14 setAccessTokensToServers,
15 setDefaultVideoChannel 15 setDefaultVideoChannel
16} from '@shared/extra-utils' 16} from '@shared/extra-utils'
@@ -25,7 +25,7 @@ import {
25} from '@shared/models' 25} from '@shared/models'
26 26
27describe('Test video playlists API validator', function () { 27describe('Test video playlists API validator', function () {
28 let server: ServerInfo 28 let server: PeerTubeServer
29 let userAccessToken: string 29 let userAccessToken: string
30 30
31 let playlist: VideoPlaylistCreateResult 31 let playlist: VideoPlaylistCreateResult
@@ -42,7 +42,7 @@ describe('Test video playlists API validator', function () {
42 before(async function () { 42 before(async function () {
43 this.timeout(30000) 43 this.timeout(30000)
44 44
45 server = await flushAndRunServer(1) 45 server = await createSingleServer(1)
46 46
47 await setAccessTokensToServers([ server ]) 47 await setAccessTokensToServers([ server ])
48 await setDefaultVideoChannel([ server ]) 48 await setDefaultVideoChannel([ server ])
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts
index cbfdef1db..e4e799cc7 100644
--- a/server/tests/api/check-params/videos-filter.ts
+++ b/server/tests/api/check-params/videos-filter.ts
@@ -3,16 +3,16 @@
3import 'mocha' 3import 'mocha'
4import { 4import {
5 cleanupTests, 5 cleanupTests,
6 flushAndRunServer, 6 createSingleServer,
7 makeGetRequest, 7 makeGetRequest,
8 ServerInfo, 8 PeerTubeServer,
9 setAccessTokensToServers, 9 setAccessTokensToServers,
10 setDefaultVideoChannel 10 setDefaultVideoChannel
11} from '../../../../shared/extra-utils' 11} from '../../../../shared/extra-utils'
12import { UserRole } from '../../../../shared/models/users' 12import { UserRole } from '../../../../shared/models/users'
13import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 13import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
14 14
15async function testEndpoints (server: ServerInfo, token: string, filter: string, statusCodeExpected: HttpStatusCode) { 15async function testEndpoints (server: PeerTubeServer, token: string, filter: string, statusCodeExpected: HttpStatusCode) {
16 const paths = [ 16 const paths = [
17 '/api/v1/video-channels/root_channel/videos', 17 '/api/v1/video-channels/root_channel/videos',
18 '/api/v1/accounts/root/videos', 18 '/api/v1/accounts/root/videos',
@@ -34,7 +34,7 @@ async function testEndpoints (server: ServerInfo, token: string, filter: string,
34} 34}
35 35
36describe('Test video filters validators', function () { 36describe('Test video filters validators', function () {
37 let server: ServerInfo 37 let server: PeerTubeServer
38 let userAccessToken: string 38 let userAccessToken: string
39 let moderatorAccessToken: string 39 let moderatorAccessToken: string
40 40
@@ -43,7 +43,7 @@ describe('Test video filters validators', function () {
43 before(async function () { 43 before(async function () {
44 this.timeout(30000) 44 this.timeout(30000)
45 45
46 server = await flushAndRunServer(1) 46 server = await createSingleServer(1)
47 47
48 await setAccessTokensToServers([ server ]) 48 await setAccessTokensToServers([ server ])
49 await setDefaultVideoChannel([ server ]) 49 await setDefaultVideoChannel([ server ])
diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts
index 549c9fa1f..3c1f479e4 100644
--- a/server/tests/api/check-params/videos-history.ts
+++ b/server/tests/api/check-params/videos-history.ts
@@ -6,11 +6,11 @@ import {
6 checkBadCountPagination, 6 checkBadCountPagination,
7 checkBadStartPagination, 7 checkBadStartPagination,
8 cleanupTests, 8 cleanupTests,
9 flushAndRunServer, 9 createSingleServer,
10 makeGetRequest, 10 makeGetRequest,
11 makePostBodyRequest, 11 makePostBodyRequest,
12 makePutBodyRequest, 12 makePutBodyRequest,
13 ServerInfo, 13 PeerTubeServer,
14 setAccessTokensToServers 14 setAccessTokensToServers
15} from '@shared/extra-utils' 15} from '@shared/extra-utils'
16 16
@@ -18,14 +18,14 @@ describe('Test videos history API validator', function () {
18 const myHistoryPath = '/api/v1/users/me/history/videos' 18 const myHistoryPath = '/api/v1/users/me/history/videos'
19 const myHistoryRemove = myHistoryPath + '/remove' 19 const myHistoryRemove = myHistoryPath + '/remove'
20 let watchingPath: string 20 let watchingPath: string
21 let server: ServerInfo 21 let server: PeerTubeServer
22 22
23 // --------------------------------------------------------------- 23 // ---------------------------------------------------------------
24 24
25 before(async function () { 25 before(async function () {
26 this.timeout(30000) 26 this.timeout(30000)
27 27
28 server = await flushAndRunServer(1) 28 server = await createSingleServer(1)
29 29
30 await setAccessTokensToServers([ server ]) 30 await setAccessTokensToServers([ server ])
31 31
diff --git a/server/tests/api/check-params/videos-overviews.ts b/server/tests/api/check-params/videos-overviews.ts
index 3597c81d3..c2139d74b 100644
--- a/server/tests/api/check-params/videos-overviews.ts
+++ b/server/tests/api/check-params/videos-overviews.ts
@@ -1,17 +1,17 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { cleanupTests, flushAndRunServer, ServerInfo } from '@shared/extra-utils' 4import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/extra-utils'
5 5
6describe('Test videos overview', function () { 6describe('Test videos overview', function () {
7 let server: ServerInfo 7 let server: PeerTubeServer
8 8
9 // --------------------------------------------------------------- 9 // ---------------------------------------------------------------
10 10
11 before(async function () { 11 before(async function () {
12 this.timeout(30000) 12 this.timeout(30000)
13 13
14 server = await flushAndRunServer(1) 14 server = await createSingleServer(1)
15 }) 15 })
16 16
17 describe('When getting videos overview', function () { 17 describe('When getting videos overview', function () {
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index 69bdae7cf..c60de2640 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -11,13 +11,13 @@ import {
11 checkBadStartPagination, 11 checkBadStartPagination,
12 checkUploadVideoParam, 12 checkUploadVideoParam,
13 cleanupTests, 13 cleanupTests,
14 flushAndRunServer, 14 createSingleServer,
15 makeDeleteRequest, 15 makeDeleteRequest,
16 makeGetRequest, 16 makeGetRequest,
17 makePutBodyRequest, 17 makePutBodyRequest,
18 makeUploadRequest, 18 makeUploadRequest,
19 root, 19 root,
20 ServerInfo, 20 PeerTubeServer,
21 setAccessTokensToServers 21 setAccessTokensToServers
22} from '@shared/extra-utils' 22} from '@shared/extra-utils'
23import { PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' 23import { PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
@@ -26,7 +26,7 @@ const expect = chai.expect
26 26
27describe('Test videos API validator', function () { 27describe('Test videos API validator', function () {
28 const path = '/api/v1/videos/' 28 const path = '/api/v1/videos/'
29 let server: ServerInfo 29 let server: PeerTubeServer
30 let userAccessToken = '' 30 let userAccessToken = ''
31 let accountName: string 31 let accountName: string
32 let channelId: number 32 let channelId: number
@@ -38,7 +38,7 @@ describe('Test videos API validator', function () {
38 before(async function () { 38 before(async function () {
39 this.timeout(30000) 39 this.timeout(30000)
40 40
41 server = await flushAndRunServer(1) 41 server = await createSingleServer(1)
42 42
43 await setAccessTokensToServers([ server ]) 43 await setAccessTokensToServers([ server ])
44 44