aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-channel-syncs.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-04-21 15:00:01 +0200
committerChocobozzz <chocobozzz@cpy.re>2023-05-09 08:57:34 +0200
commitd102de1b38f2877463529c3b27bd35ffef4fd8bf (patch)
tree31fa0bdf26ad7a2ee46d600d804a6f03260266c8 /server/tests/api/videos/video-channel-syncs.ts
parent2fe978744e5b74eb824e4d79c1bb9b840169f125 (diff)
downloadPeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.gz
PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.zst
PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.zip
Add runner server tests
Diffstat (limited to 'server/tests/api/videos/video-channel-syncs.ts')
-rw-r--r--server/tests/api/videos/video-channel-syncs.ts11
1 files changed, 9 insertions, 2 deletions
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 @@
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
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { FIXTURE_URLS } from '@server/tests/shared' 4import { FIXTURE_URLS, SQLCommand } from '@server/tests/shared'
5import { areHttpImportTestsDisabled } from '@shared/core-utils' 5import { areHttpImportTestsDisabled } from '@shared/core-utils'
6import { VideoChannelSyncState, VideoInclude, VideoPrivacy } from '@shared/models' 6import { VideoChannelSyncState, VideoInclude, VideoPrivacy } from '@shared/models'
7import { 7import {
@@ -23,6 +23,7 @@ describe('Test channel synchronizations', function () {
23 23
24 describe('Sync using ' + mode, function () { 24 describe('Sync using ' + mode, function () {
25 let servers: PeerTubeServer[] 25 let servers: PeerTubeServer[]
26 let sqlCommands: SQLCommand[]
26 27
27 let startTestDate: Date 28 let startTestDate: Date
28 29
@@ -36,7 +37,7 @@ describe('Test channel synchronizations', function () {
36 } 37 }
37 38
38 async function changeDateForSync (channelSyncId: number, newDate: string) { 39 async function changeDateForSync (channelSyncId: number, newDate: string) {
39 await servers[0].sql.updateQuery( 40 await sqlCommands[0].updateQuery(
40 `UPDATE "videoChannelSync" ` + 41 `UPDATE "videoChannelSync" ` +
41 `SET "createdAt"='${newDate}', "lastSyncAt"='${newDate}' ` + 42 `SET "createdAt"='${newDate}', "lastSyncAt"='${newDate}' ` +
42 `WHERE id=${channelSyncId}` 43 `WHERE id=${channelSyncId}`
@@ -82,6 +83,8 @@ describe('Test channel synchronizations', function () {
82 const { videoChannels } = await servers[0].users.getMyInfo({ token: userInfo.accessToken }) 83 const { videoChannels } = await servers[0].users.getMyInfo({ token: userInfo.accessToken })
83 userInfo.channelId = videoChannels[0].id 84 userInfo.channelId = videoChannels[0].id
84 } 85 }
86
87 sqlCommands = servers.map(s => new SQLCommand(s))
85 }) 88 })
86 89
87 it('Should fetch the latest channel videos of a remote channel', async function () { 90 it('Should fetch the latest channel videos of a remote channel', async function () {
@@ -302,6 +305,10 @@ describe('Test channel synchronizations', function () {
302 }) 305 })
303 306
304 after(async function () { 307 after(async function () {
308 for (const sqlCommand of sqlCommands) {
309 await sqlCommand.cleanup()
310 }
311
305 await killallServers(servers) 312 await killallServers(servers)
306 }) 313 })
307 }) 314 })