X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-channel-syncs.ts;h=a31e48d1d2524e2f93e1a643dd6a69bac1ae2a72;hb=d102de1b38f2877463529c3b27bd35ffef4fd8bf;hp=dd483f95ecbdd0d654e409648e97256eef4ebad0;hpb=9972ace3a3bc65865fb3aaaa865a400386e49252;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-channel-syncs.ts b/server/tests/api/videos/video-channel-syncs.ts index dd483f95e..a31e48d1d 100644 --- a/server/tests/api/videos/video-channel-syncs.ts +++ b/server/tests/api/videos/video-channel-syncs.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' -import { FIXTURE_URLS } from '@server/tests/shared' +import { FIXTURE_URLS, SQLCommand } from '@server/tests/shared' import { areHttpImportTestsDisabled } from '@shared/core-utils' import { VideoChannelSyncState, VideoInclude, VideoPrivacy } from '@shared/models' import { @@ -23,6 +23,7 @@ describe('Test channel synchronizations', function () { describe('Sync using ' + mode, function () { let servers: PeerTubeServer[] + let sqlCommands: SQLCommand[] let startTestDate: Date @@ -36,7 +37,7 @@ describe('Test channel synchronizations', function () { } async function changeDateForSync (channelSyncId: number, newDate: string) { - await servers[0].sql.updateQuery( + await sqlCommands[0].updateQuery( `UPDATE "videoChannelSync" ` + `SET "createdAt"='${newDate}', "lastSyncAt"='${newDate}' ` + `WHERE id=${channelSyncId}` @@ -82,6 +83,8 @@ describe('Test channel synchronizations', function () { const { videoChannels } = await servers[0].users.getMyInfo({ token: userInfo.accessToken }) userInfo.channelId = videoChannels[0].id } + + sqlCommands = servers.map(s => new SQLCommand(s)) }) it('Should fetch the latest channel videos of a remote channel', async function () { @@ -302,6 +305,10 @@ describe('Test channel synchronizations', function () { }) after(async function () { + for (const sqlCommand of sqlCommands) { + await sqlCommand.cleanup() + } + await killallServers(servers) }) })