From faa9d434b4d681837ff2a87603337c2623419669 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jun 2020 10:55:40 +0200 Subject: Update server dependencies --- server/tests/api/check-params/users.ts | 7 ------- server/tests/api/check-params/video-abuses.ts | 14 -------------- server/tests/api/check-params/video-imports.ts | 3 --- server/tests/api/check-params/video-playlists.ts | 3 --- server/tests/api/ci-2.sh | 2 +- server/tests/api/ci-4.sh | 2 +- .../api/notifications/comments-notifications.ts | 22 +++++++++++----------- 7 files changed, 13 insertions(+), 40 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 472fbda43..74f0a2d3f 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -55,8 +55,6 @@ describe('Test users API validators', function () { let moderatorAccessToken = '' let emailPort: number let overrideConfig: Object - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let channelId: number // --------------------------------------------------------------- @@ -129,11 +127,6 @@ describe('Test users API validators', function () { }) } - { - const res = await getMyUserInformation(server.url, server.accessToken) - channelId = res.body.videoChannels[0].id - } - { const res = await uploadVideo(server.url, server.accessToken, {}) videoId = res.body.video.id diff --git a/server/tests/api/check-params/video-abuses.ts b/server/tests/api/check-params/video-abuses.ts index e643cb95e..a3fe00ffb 100644 --- a/server/tests/api/check-params/video-abuses.ts +++ b/server/tests/api/check-params/video-abuses.ts @@ -141,13 +141,6 @@ describe('Test video abuses API validators', function () { }) describe('When updating a video abuse', function () { - const basePath = '/api/v1/videos/' - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let path: string - - before(() => { - path = basePath + server.video.id + '/abuse/' + videoAbuseId - }) it('Should fail with a non authenticated user', async function () { await updateVideoAbuse(server.url, 'blabla', server.video.uuid, videoAbuseId, {}, 401) @@ -179,13 +172,6 @@ describe('Test video abuses API validators', function () { }) describe('When deleting a video abuse', function () { - const basePath = '/api/v1/videos/' - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let path: string - - before(() => { - path = basePath + server.video.id + '/abuse/' + videoAbuseId - }) it('Should fail with a non authenticated user', async function () { await deleteVideoAbuse(server.url, 'blabla', server.video.uuid, videoAbuseId, 401) diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index dbea39c48..3759e47c4 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -29,8 +29,6 @@ describe('Test video imports API validator', function () { const path = '/api/v1/videos/imports' let server: ServerInfo let userAccessToken = '' - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let accountName: string let channelId: number // --------------------------------------------------------------- @@ -50,7 +48,6 @@ describe('Test video imports API validator', function () { { const res = await getMyUserInformation(server.url, server.accessToken) channelId = res.body.videoChannels[0].id - accountName = res.body.account.name + '@' + res.body.account.host } }) diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 0410e737a..46ec00d46 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts @@ -36,8 +36,6 @@ describe('Test video playlists API validator', function () { let privatePlaylistUUID: string let watchLaterPlaylistId: number let videoId: number - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let videoId2: number let playlistElementId: number // --------------------------------------------------------------- @@ -52,7 +50,6 @@ describe('Test video playlists API validator', function () { userAccessToken = await generateUserAccessToken(server, 'user1') videoId = (await uploadVideoAndGetId({ server, videoName: 'video 1' })).id - videoId2 = (await uploadVideoAndGetId({ server, videoName: 'video 2' })).id { const res = await getAccountPlaylistsListWithToken(server.url, server.accessToken, 'root', 0, 5, VideoPlaylistType.WATCH_LATER) diff --git a/server/tests/api/ci-2.sh b/server/tests/api/ci-2.sh index 52c839d12..016df1cfc 100644 --- a/server/tests/api/ci-2.sh +++ b/server/tests/api/ci-2.sh @@ -5,6 +5,6 @@ set -eu serverFiles=$(find server/tests/api/server -type f | grep -v index.ts | xargs echo) usersFiles=$(find server/tests/api/users -type f | grep -v index.ts | xargs echo) -MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit \ +MOCHA_PARALLEL=true npm run mocha -- --parallel --jobs $1 --timeout 30000 --exit \ --require ts-node/register --require tsconfig-paths/register --bail \ $serverFiles $usersFiles diff --git a/server/tests/api/ci-4.sh b/server/tests/api/ci-4.sh index 22785cf33..7d83cbdfc 100644 --- a/server/tests/api/ci-4.sh +++ b/server/tests/api/ci-4.sh @@ -5,6 +5,6 @@ set -eu redundancyFiles=$(find server/tests/api/redundancy -type f | grep -v index.ts | xargs echo) activitypubFiles=$(find server/tests/api/activitypub -type f | grep -v index.ts | xargs echo) -MOCHA_PARALLEL=true npm run mocha-parallel-tests -- --max-parallel $1 --timeout 30000 --exit \ +MOCHA_PARALLEL=true npm run mocha -- --parallel --jobs $1 --timeout 30000 --exit \ --require ts-node/register --require tsconfig-paths/register --bail \ $redundancyFiles $activitypubFiles diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts index cd3ed2f70..dfe846cc4 100644 --- a/server/tests/api/notifications/comments-notifications.ts +++ b/server/tests/api/notifications/comments-notifications.ts @@ -2,7 +2,7 @@ import 'mocha' import * as chai from 'chai' -import { cleanupTests, getVideoCommentThreads, getVideoThreadComments, updateMyUser, wait } from '../../../../shared/extra-utils' +import { cleanupTests, getVideoCommentThreads, getVideoThreadComments, updateMyUser } from '../../../../shared/extra-utils' import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' @@ -56,7 +56,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') }) @@ -69,7 +69,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, 'comment') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') }) @@ -84,7 +84,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') @@ -99,7 +99,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'presence') }) @@ -134,7 +134,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'reply') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, threadId, 'presence') }) @@ -200,7 +200,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') }) @@ -213,7 +213,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, '@user_1 hello') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') }) @@ -228,7 +228,7 @@ describe('Test comments notifications', function () { const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') @@ -257,13 +257,13 @@ describe('Test comments notifications', function () { const resThread = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello 1') const threadId = resThread.body.comment.id - await wait(500) + await waitJobs(servers) await checkCommentMention(baseParams, uuid, threadId, threadId, 'super root name', 'presence') const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'hello 2 @user_1') const commentId = resComment.body.comment.id - await wait(500) + await waitJobs(servers) await checkCommentMention(baseParams, uuid, commentId, threadId, 'super root name', 'presence') }) -- cgit v1.2.3