aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:47:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch)
treeeaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/api/search
parent89d241a79c262b9775c233b73cff080043ebb5e6 (diff)
downloadPeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip
Use an object to represent a server
Diffstat (limited to 'server/tests/api/search')
-rw-r--r--server/tests/api/search/search-activitypub-video-channels.ts8
-rw-r--r--server/tests/api/search/search-activitypub-video-playlists.ts8
-rw-r--r--server/tests/api/search/search-activitypub-videos.ts8
-rw-r--r--server/tests/api/search/search-channels.ts6
-rw-r--r--server/tests/api/search/search-index.ts6
-rw-r--r--server/tests/api/search/search-playlists.ts8
-rw-r--r--server/tests/api/search/search-videos.ts8
7 files changed, 26 insertions, 26 deletions
diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.ts
index 71e9367e5..f5896ec25 100644
--- a/server/tests/api/search/search-activitypub-video-channels.ts
+++ b/server/tests/api/search/search-activitypub-video-channels.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunMultipleServers, 7 createMultipleServers,
8 SearchCommand, 8 SearchCommand,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
12 waitJobs 12 waitJobs
@@ -16,7 +16,7 @@ import { VideoChannel } from '@shared/models'
16const expect = chai.expect 16const expect = chai.expect
17 17
18describe('Test ActivityPub video channels search', function () { 18describe('Test ActivityPub video channels search', function () {
19 let servers: ServerInfo[] 19 let servers: PeerTubeServer[]
20 let userServer2Token: string 20 let userServer2Token: string
21 let videoServer2UUID: string 21 let videoServer2UUID: string
22 let channelIdServer2: number 22 let channelIdServer2: number
@@ -25,7 +25,7 @@ describe('Test ActivityPub video channels search', function () {
25 before(async function () { 25 before(async function () {
26 this.timeout(120000) 26 this.timeout(120000)
27 27
28 servers = await flushAndRunMultipleServers(2) 28 servers = await createMultipleServers(2)
29 29
30 await setAccessTokensToServers(servers) 30 await setAccessTokensToServers(servers)
31 31
diff --git a/server/tests/api/search/search-activitypub-video-playlists.ts b/server/tests/api/search/search-activitypub-video-playlists.ts
index 7c99b954b..ada2d3d6c 100644
--- a/server/tests/api/search/search-activitypub-video-playlists.ts
+++ b/server/tests/api/search/search-activitypub-video-playlists.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunMultipleServers, 7 createMultipleServers,
8 SearchCommand, 8 SearchCommand,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
12 wait, 12 wait,
@@ -17,7 +17,7 @@ import { VideoPlaylistPrivacy } from '@shared/models'
17const expect = chai.expect 17const expect = chai.expect
18 18
19describe('Test ActivityPub playlists search', function () { 19describe('Test ActivityPub playlists search', function () {
20 let servers: ServerInfo[] 20 let servers: PeerTubeServer[]
21 let playlistServer1UUID: string 21 let playlistServer1UUID: string
22 let playlistServer2UUID: string 22 let playlistServer2UUID: string
23 let video2Server2: string 23 let video2Server2: string
@@ -27,7 +27,7 @@ describe('Test ActivityPub playlists search', function () {
27 before(async function () { 27 before(async function () {
28 this.timeout(120000) 28 this.timeout(120000)
29 29
30 servers = await flushAndRunMultipleServers(2) 30 servers = await createMultipleServers(2)
31 31
32 await setAccessTokensToServers(servers) 32 await setAccessTokensToServers(servers)
33 await setDefaultVideoChannel(servers) 33 await setDefaultVideoChannel(servers)
diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts
index 0dfc63446..a015b72a7 100644
--- a/server/tests/api/search/search-activitypub-videos.ts
+++ b/server/tests/api/search/search-activitypub-videos.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunMultipleServers, 7 createMultipleServers,
8 SearchCommand, 8 SearchCommand,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
12 waitJobs 12 waitJobs
@@ -16,7 +16,7 @@ import { VideoPrivacy } from '@shared/models'
16const expect = chai.expect 16const expect = chai.expect
17 17
18describe('Test ActivityPub videos search', function () { 18describe('Test ActivityPub videos search', function () {
19 let servers: ServerInfo[] 19 let servers: PeerTubeServer[]
20 let videoServer1UUID: string 20 let videoServer1UUID: string
21 let videoServer2UUID: string 21 let videoServer2UUID: string
22 22
@@ -25,7 +25,7 @@ describe('Test ActivityPub videos search', function () {
25 before(async function () { 25 before(async function () {
26 this.timeout(120000) 26 this.timeout(120000)
27 27
28 servers = await flushAndRunMultipleServers(2) 28 servers = await createMultipleServers(2)
29 29
30 await setAccessTokensToServers(servers) 30 await setAccessTokensToServers(servers)
31 31
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts
index 7035fbd62..07e00a214 100644
--- a/server/tests/api/search/search-channels.ts
+++ b/server/tests/api/search/search-channels.ts
@@ -2,19 +2,19 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, flushAndRunServer, SearchCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
6import { VideoChannel } from '@shared/models' 6import { VideoChannel } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
9 9
10describe('Test channels search', function () { 10describe('Test channels search', function () {
11 let server: ServerInfo = null 11 let server: PeerTubeServer = null
12 let command: SearchCommand 12 let command: SearchCommand
13 13
14 before(async function () { 14 before(async function () {
15 this.timeout(30000) 15 this.timeout(30000)
16 16
17 server = await flushAndRunServer(1) 17 server = await createSingleServer(1)
18 18
19 await setAccessTokensToServers([ server ]) 19 await setAccessTokensToServers([ server ])
20 20
diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts
index b54c0da22..38edcf7c6 100644
--- a/server/tests/api/search/search-index.ts
+++ b/server/tests/api/search/search-index.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, flushAndRunServer, SearchCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
6import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models' 6import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
@@ -10,13 +10,13 @@ const expect = chai.expect
10describe('Test videos search', function () { 10describe('Test videos search', function () {
11 const localVideoName = 'local video' + new Date().toISOString() 11 const localVideoName = 'local video' + new Date().toISOString()
12 12
13 let server: ServerInfo = null 13 let server: PeerTubeServer = null
14 let command: SearchCommand 14 let command: SearchCommand
15 15
16 before(async function () { 16 before(async function () {
17 this.timeout(30000) 17 this.timeout(30000)
18 18
19 server = await flushAndRunServer(1) 19 server = await createSingleServer(1)
20 20
21 await setAccessTokensToServers([ server ]) 21 await setAccessTokensToServers([ server ])
22 22
diff --git a/server/tests/api/search/search-playlists.ts b/server/tests/api/search/search-playlists.ts
index e15128c8e..b29c2d127 100644
--- a/server/tests/api/search/search-playlists.ts
+++ b/server/tests/api/search/search-playlists.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 SearchCommand, 8 SearchCommand,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel 11 setDefaultVideoChannel
12} from '@shared/extra-utils' 12} from '@shared/extra-utils'
@@ -15,13 +15,13 @@ import { VideoPlaylistPrivacy } from '@shared/models'
15const expect = chai.expect 15const expect = chai.expect
16 16
17describe('Test playlists search', function () { 17describe('Test playlists search', function () {
18 let server: ServerInfo = null 18 let server: PeerTubeServer = null
19 let command: SearchCommand 19 let command: SearchCommand
20 20
21 before(async function () { 21 before(async function () {
22 this.timeout(30000) 22 this.timeout(30000)
23 23
24 server = await flushAndRunServer(1) 24 server = await createSingleServer(1)
25 25
26 await setAccessTokensToServers([ server ]) 26 await setAccessTokensToServers([ server ])
27 await setDefaultVideoChannel([ server ]) 27 await setDefaultVideoChannel([ server ])
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 478ebafc9..a9b0a4fcd 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 flushAndRunServer, 7 createSingleServer,
8 SearchCommand, 8 SearchCommand,
9 ServerInfo, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
12 stopFfmpeg, 12 stopFfmpeg,
@@ -17,7 +17,7 @@ import { VideoPrivacy } from '@shared/models'
17const expect = chai.expect 17const expect = chai.expect
18 18
19describe('Test videos search', function () { 19describe('Test videos search', function () {
20 let server: ServerInfo = null 20 let server: PeerTubeServer = null
21 let startDate: string 21 let startDate: string
22 let videoUUID: string 22 let videoUUID: string
23 23
@@ -26,7 +26,7 @@ describe('Test videos search', function () {
26 before(async function () { 26 before(async function () {
27 this.timeout(60000) 27 this.timeout(60000)
28 28
29 server = await flushAndRunServer(1) 29 server = await createSingleServer(1)
30 30
31 await setAccessTokensToServers([ server ]) 31 await setAccessTokensToServers([ server ])
32 await setDefaultVideoChannel([ server ]) 32 await setDefaultVideoChannel([ server ])