diff options
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/video-captions.ts | 2 | ||||
-rw-r--r-- | server/tests/api/videos/video-playlists.ts | 38 | ||||
-rw-r--r-- | server/tests/api/videos/videos-views-cleaner.ts | 2 |
3 files changed, 18 insertions, 24 deletions
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index 00e04d69d..5b36dc021 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts | |||
@@ -28,7 +28,7 @@ describe('Test video captions', function () { | |||
28 | let videoUUID: string | 28 | let videoUUID: string |
29 | 29 | ||
30 | before(async function () { | 30 | before(async function () { |
31 | this.timeout(30000) | 31 | this.timeout(60000) |
32 | 32 | ||
33 | servers = await flushAndRunMultipleServers(2) | 33 | servers = await flushAndRunMultipleServers(2) |
34 | 34 | ||
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index 0a96ea9a0..9dad58c8c 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts | |||
@@ -1,7 +1,8 @@ | |||
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 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { | 6 | import { |
6 | addVideoChannel, | 7 | addVideoChannel, |
7 | addVideoInPlaylist, | 8 | addVideoInPlaylist, |
@@ -44,13 +45,6 @@ import { | |||
44 | wait, | 45 | wait, |
45 | waitJobs | 46 | waitJobs |
46 | } from '../../../../shared/extra-utils' | 47 | } from '../../../../shared/extra-utils' |
47 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | ||
48 | import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model' | ||
49 | import { VideoPrivacy } from '../../../../shared/models/videos' | ||
50 | import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' | ||
51 | import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | ||
52 | import { User } from '../../../../shared/models/users' | ||
53 | import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model' | ||
54 | import { | 48 | import { |
55 | addAccountToAccountBlocklist, | 49 | addAccountToAccountBlocklist, |
56 | addAccountToServerBlocklist, | 50 | addAccountToServerBlocklist, |
@@ -61,7 +55,13 @@ import { | |||
61 | removeServerFromAccountBlocklist, | 55 | removeServerFromAccountBlocklist, |
62 | removeServerFromServerBlocklist | 56 | removeServerFromServerBlocklist |
63 | } from '../../../../shared/extra-utils/users/blocklist' | 57 | } from '../../../../shared/extra-utils/users/blocklist' |
64 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 58 | import { User } from '../../../../shared/models/users' |
59 | import { VideoPrivacy } from '../../../../shared/models/videos' | ||
60 | import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | ||
61 | import { VideoPlaylistElement, VideoPlaylistElementType } from '../../../../shared/models/videos/playlist/video-playlist-element.model' | ||
62 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | ||
63 | import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' | ||
64 | import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-playlist.model' | ||
65 | 65 | ||
66 | const expect = chai.expect | 66 | const expect = chai.expect |
67 | 67 | ||
@@ -123,24 +123,18 @@ describe('Test video playlists', function () { | |||
123 | await doubleFollow(servers[0], servers[2]) | 123 | await doubleFollow(servers[0], servers[2]) |
124 | 124 | ||
125 | { | 125 | { |
126 | const serverPromises: Promise<any>[][] = [] | 126 | servers[0].videos = [] |
127 | servers[1].videos = [] | ||
128 | servers[2].videos = [] | ||
127 | 129 | ||
128 | for (const server of servers) { | 130 | for (const server of servers) { |
129 | const videoPromises: Promise<any>[] = [] | ||
130 | |||
131 | for (let i = 0; i < 7; i++) { | 131 | for (let i = 0; i < 7; i++) { |
132 | videoPromises.push( | 132 | const name = `video ${i} server ${server.serverNumber}` |
133 | uploadVideo(server.url, server.accessToken, { name: `video ${i} server ${server.serverNumber}`, nsfw: false }) | 133 | const resVideo = await uploadVideo(server.url, server.accessToken, { name, nsfw: false }) |
134 | .then(res => res.body.video) | ||
135 | ) | ||
136 | } | ||
137 | 134 | ||
138 | serverPromises.push(videoPromises) | 135 | server.videos.push(resVideo.body.video) |
136 | } | ||
139 | } | 137 | } |
140 | |||
141 | servers[0].videos = await Promise.all(serverPromises[0]) | ||
142 | servers[1].videos = await Promise.all(serverPromises[1]) | ||
143 | servers[2].videos = await Promise.all(serverPromises[2]) | ||
144 | } | 138 | } |
145 | 139 | ||
146 | nsfwVideoServer1 = (await uploadVideoAndGetId({ server: servers[0], videoName: 'NSFW video', nsfw: true })).id | 140 | nsfwVideoServer1 = (await uploadVideoAndGetId({ server: servers[0], videoName: 'NSFW video', nsfw: true })).id |
diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts index c5b28540c..b89f33217 100644 --- a/server/tests/api/videos/videos-views-cleaner.ts +++ b/server/tests/api/videos/videos-views-cleaner.ts | |||
@@ -27,7 +27,7 @@ describe('Test video views cleaner', function () { | |||
27 | let videoIdServer2: string | 27 | let videoIdServer2: string |
28 | 28 | ||
29 | before(async function () { | 29 | before(async function () { |
30 | this.timeout(50000) | 30 | this.timeout(120000) |
31 | 31 | ||
32 | servers = await flushAndRunMultipleServers(2) | 32 | servers = await flushAndRunMultipleServers(2) |
33 | await setAccessTokensToServers(servers) | 33 | await setAccessTokensToServers(servers) |