aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-22 17:04:39 +0200
committerChocobozzz <me@florianbigard.com>2023-05-22 17:11:31 +0200
commit83002a823465fe03a8d82833cb2e073a383405a8 (patch)
tree1b28e2d98c192b1be513cc448be301360f33c8ad /server/tests
parent57c318653e6a8ae9d0c2541a62853fb8dd582d5d (diff)
downloadPeerTube-83002a823465fe03a8d82833cb2e073a383405a8.tar.gz
PeerTube-83002a823465fe03a8d82833cb2e073a383405a8.tar.zst
PeerTube-83002a823465fe03a8d82833cb2e073a383405a8.zip
Update server dependencies
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/upload-quota.ts2
-rw-r--r--server/tests/api/redundancy/redundancy.ts4
-rw-r--r--server/tests/api/server/tracker.ts6
-rw-r--r--server/tests/peertube-runner/vod-transcoding.ts2
-rw-r--r--server/tests/shared/mock-servers/mock-proxy.ts4
5 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.ts
index 008537524..06698c056 100644
--- a/server/tests/api/check-params/upload-quota.ts
+++ b/server/tests/api/check-params/upload-quota.ts
@@ -54,7 +54,7 @@ describe('Test upload quota', function () {
54 }) 54 })
55 55
56 it('Should fail with a registered user having too many videos with resumable upload', async function () { 56 it('Should fail with a registered user having too many videos with resumable upload', async function () {
57 this.timeout(30000) 57 this.timeout(120000)
58 58
59 const user = { username: 'registered' + randomInt(1, 1500), password: 'password' } 59 const user = { username: 'registered' + randomInt(1, 1500), password: 'password' }
60 await server.registrations.register(user) 60 await server.registrations.register(user)
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts
index 57939775e..5262c503f 100644
--- a/server/tests/api/redundancy/redundancy.ts
+++ b/server/tests/api/redundancy/redundancy.ts
@@ -2,7 +2,7 @@
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { readdir } from 'fs-extra' 4import { readdir } from 'fs-extra'
5import magnetUtil from 'magnet-uri' 5import { decode as magnetUriDecode } from 'magnet-uri'
6import { basename, join } from 'path' 6import { basename, join } from 'path'
7import { checkSegmentHash, checkVideoFilesWereRemoved, saveVideoInServers } from '@server/tests/shared' 7import { checkSegmentHash, checkVideoFilesWereRemoved, saveVideoInServers } from '@server/tests/shared'
8import { wait } from '@shared/core-utils' 8import { wait } from '@shared/core-utils'
@@ -29,7 +29,7 @@ let servers: PeerTubeServer[] = []
29let video1Server2: VideoDetails 29let video1Server2: VideoDetails
30 30
31async function checkMagnetWebseeds (file: VideoFile, baseWebseeds: string[], server: PeerTubeServer) { 31async function checkMagnetWebseeds (file: VideoFile, baseWebseeds: string[], server: PeerTubeServer) {
32 const parsed = magnetUtil.decode(file.magnetUri) 32 const parsed = magnetUriDecode(file.magnetUri)
33 33
34 for (const ws of baseWebseeds) { 34 for (const ws of baseWebseeds) {
35 const found = parsed.urlList.find(url => url === `${ws}${basename(file.fileUrl)}`) 35 const found = parsed.urlList.find(url => url === `${ws}${basename(file.fileUrl)}`)
diff --git a/server/tests/api/server/tracker.ts b/server/tests/api/server/tracker.ts
index 34d450998..a0ce2ca35 100644
--- a/server/tests/api/server/tracker.ts
+++ b/server/tests/api/server/tracker.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await,@typescript-eslint/no-floating-promises */
2 2
3import magnetUtil from 'magnet-uri' 3import { decode as magnetUriDecode, encode as magnetUriEncode } from 'magnet-uri'
4import WebTorrent from 'webtorrent' 4import WebTorrent from 'webtorrent'
5import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' 5import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
6 6
@@ -19,10 +19,10 @@ describe('Test tracker', function () {
19 const video = await server.videos.get({ id: uuid }) 19 const video = await server.videos.get({ id: uuid })
20 goodMagnet = video.files[0].magnetUri 20 goodMagnet = video.files[0].magnetUri
21 21
22 const parsed = magnetUtil.decode(goodMagnet) 22 const parsed = magnetUriDecode(goodMagnet)
23 parsed.infoHash = '010597bb88b1968a5693a4fa8267c592ca65f2e9' 23 parsed.infoHash = '010597bb88b1968a5693a4fa8267c592ca65f2e9'
24 24
25 badMagnet = magnetUtil.encode(parsed) 25 badMagnet = magnetUriEncode(parsed)
26 } 26 }
27 }) 27 })
28 28
diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.ts
index f1670c1fb..dc505baab 100644
--- a/server/tests/peertube-runner/vod-transcoding.ts
+++ b/server/tests/peertube-runner/vod-transcoding.ts
@@ -189,7 +189,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
189 }) 189 })
190 190
191 it('Should transcode videos on manual run', async function () { 191 it('Should transcode videos on manual run', async function () {
192 this.timeout(360000) 192 this.timeout(120000)
193 193
194 await servers[0].config.disableTranscoding() 194 await servers[0].config.disableTranscoding()
195 195
diff --git a/server/tests/shared/mock-servers/mock-proxy.ts b/server/tests/shared/mock-servers/mock-proxy.ts
index cbc7c4466..e741d6735 100644
--- a/server/tests/shared/mock-servers/mock-proxy.ts
+++ b/server/tests/shared/mock-servers/mock-proxy.ts
@@ -1,5 +1,5 @@
1import { createServer, Server } from 'http' 1import { createServer, Server } from 'http'
2import proxy from 'proxy' 2import { createProxy } from 'proxy'
3import { getPort, terminateServer } from './shared' 3import { getPort, terminateServer } from './shared'
4 4
5class MockProxy { 5class MockProxy {
@@ -7,7 +7,7 @@ class MockProxy {
7 7
8 initialize () { 8 initialize () {
9 return new Promise<number>(res => { 9 return new Promise<number>(res => {
10 this.server = proxy(createServer()) 10 this.server = createProxy(createServer())
11 this.server.listen(0, () => res(getPort(this.server))) 11 this.server.listen(0, () => res(getPort(this.server)))
12 }) 12 })
13 } 13 }