X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fmultiple-servers.ts;h=6c281e49e850b6b9235db85455ee2dbff5e1a9c8;hb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;hp=cab096a1250e2136e17cae987aad686b2d105431;hpb=eed24d26db4c8363d5e5874841ee0c4f5fa275a8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index cab096a12..6c281e49e 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -6,9 +6,9 @@ import { join } from 'path' import * as request from 'supertest' import { VideoPrivacy } from '../../../../shared/models/videos' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' - import { addVideoChannel, + checkTmpIsEmpty, checkVideoFilesWereRemoved, completeVideoCheck, createUser, @@ -32,15 +32,15 @@ import { viewVideo, wait, webtorrentAdd -} from '../../utils' +} from '../../../../shared/utils' import { addVideoCommentReply, addVideoCommentThread, deleteVideoComment, getVideoCommentThreads, getVideoThreadComments -} from '../../utils/videos/video-comments' -import { waitJobs } from '../../utils/server/jobs' +} from '../../../../shared/utils/videos/video-comments' +import { waitJobs } from '../../../../shared/utils/server/jobs' const expect = chai.expect @@ -60,6 +60,7 @@ describe('Test multiple servers', function () { { const videoChannel = { + name: 'super_channel_name', displayName: 'my channel', description: 'super channel' } @@ -128,7 +129,8 @@ describe('Test multiple servers', function () { privacy: VideoPrivacy.PUBLIC, commentsEnabled: true, channel: { - name: 'my channel', + displayName: 'my channel', + name: 'super_channel_name', description: 'super channel', isLocal }, @@ -201,7 +203,8 @@ describe('Test multiple servers', function () { tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ], privacy: VideoPrivacy.PUBLIC, channel: { - name: 'Default user1 channel', + displayName: 'Main user1 channel', + name: 'user1_channel', description: 'super channel', isLocal }, @@ -307,7 +310,8 @@ describe('Test multiple servers', function () { tags: [ 'tag1p3' ], privacy: VideoPrivacy.PUBLIC, channel: { - name: 'Default root channel', + displayName: 'Main root channel', + name: 'root_channel', description: '', isLocal }, @@ -339,7 +343,8 @@ describe('Test multiple servers', function () { tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ], privacy: VideoPrivacy.PUBLIC, channel: { - name: 'Default root channel', + displayName: 'Main root channel', + name: 'root_channel', description: '', isLocal }, @@ -488,7 +493,7 @@ describe('Test multiple servers', function () { }) it('Should view multiple videos on owned servers', async function () { - this.timeout(15000) + this.timeout(30000) const tasks: Promise[] = [] await viewVideo(servers[2].url, localVideosServer3[0]) @@ -507,6 +512,9 @@ describe('Test multiple servers', function () { await waitJobs(servers) + // Wait the repeatable job + await wait(6000) + for (const server of servers) { const res = await getVideosList(server.url) @@ -520,7 +528,7 @@ describe('Test multiple servers', function () { }) it('Should view multiple videos on each servers', async function () { - this.timeout(15000) + this.timeout(30000) const tasks: Promise[] = [] tasks.push(viewVideo(servers[0].url, remoteVideosServer1[0])) @@ -538,6 +546,9 @@ describe('Test multiple servers', function () { await waitJobs(servers) + // Wait the repeatable job + await wait(8000) + let baseVideos = null for (const server of servers) { @@ -647,7 +658,8 @@ describe('Test multiple servers', function () { tags: [ 'tag_up_1', 'tag_up_2' ], privacy: VideoPrivacy.PUBLIC, channel: { - name: 'Default root channel', + displayName: 'Main root channel', + name: 'root_channel', description: '', isLocal }, @@ -967,7 +979,8 @@ describe('Test multiple servers', function () { tags: [ ], privacy: VideoPrivacy.PUBLIC, channel: { - name: 'Default root channel', + displayName: 'Main root channel', + name: 'root_channel', description: '', isLocal }, @@ -975,19 +988,19 @@ describe('Test multiple servers', function () { files: [ { resolution: 720, - size: 36000 + size: 72000 }, { resolution: 480, - size: 21000 + size: 45000 }, { resolution: 360, - size: 17000 + size: 34600 }, { resolution: 240, - size: 13000 + size: 24770 } ] } @@ -996,6 +1009,14 @@ describe('Test multiple servers', function () { }) }) + describe('TMP directory', function () { + it('Should have an empty tmp directory', async function () { + for (const server of servers) { + await checkTmpIsEmpty(server) + } + }) + }) + after(async function () { killallServers(servers)