X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fredundancy%2Fredundancy-constraints.ts;h=c86573168df6ac650e74d2a98c86365cb9dbad32;hb=d102de1b38f2877463529c3b27bd35ffef4fd8bf;hp=0378cc12269661a89e93d0bb5c8970686fc04935;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/redundancy/redundancy-constraints.ts b/server/tests/api/redundancy/redundancy-constraints.ts index 0378cc122..c86573168 100644 --- a/server/tests/api/redundancy/redundancy-constraints.ts +++ b/server/tests/api/redundancy/redundancy-constraints.ts @@ -1,22 +1,20 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' import { expect } from 'chai' +import { VideoPrivacy } from '@shared/models' import { cleanupTests, - flushAndRunServer, + createSingleServer, killallServers, - reRunServer, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, waitJobs -} from '@shared/extra-utils' -import { VideoPrivacy } from '@shared/models' +} from '@shared/server-commands' describe('Test redundancy constraints', function () { - let remoteServer: ServerInfo - let localServer: ServerInfo - let servers: ServerInfo[] + let remoteServer: PeerTubeServer + let localServer: PeerTubeServer + let servers: PeerTubeServer[] const remoteServerConfig = { redundancy: { @@ -59,7 +57,7 @@ describe('Test redundancy constraints', function () { this.timeout(120000) { - remoteServer = await flushAndRunServer(1, remoteServerConfig) + remoteServer = await createSingleServer(1, remoteServerConfig) } { @@ -70,7 +68,7 @@ describe('Test redundancy constraints', function () { } } } - localServer = await flushAndRunServer(2, config) + localServer = await createSingleServer(2, config) } servers = [ remoteServer, localServer ] @@ -83,7 +81,7 @@ describe('Test redundancy constraints', function () { await waitJobs(servers) // Server 1 and server 2 follow each other - await remoteServer.follows.follow({ targets: [ localServer.url ] }) + await remoteServer.follows.follow({ hosts: [ localServer.url ] }) await waitJobs(servers) await remoteServer.redundancy.updateRedundancy({ host: localServer.host, redundancyAllowed: true }) @@ -118,8 +116,8 @@ describe('Test redundancy constraints', function () { } } } - await await killallServers([ localServer ]) - await reRunServer(localServer, config) + await killallServers([ localServer ]) + await localServer.run(config) await uploadWrapper('video 2 server 2') @@ -148,7 +146,7 @@ describe('Test redundancy constraints', function () { } } await killallServers([ localServer ]) - await reRunServer(localServer, config) + await localServer.run(config) await uploadWrapper('video 3 server 2') @@ -169,7 +167,7 @@ describe('Test redundancy constraints', function () { it('Should have redundancy on server 1 and on server 2 with followings filter now server 2 follows server 1', async function () { this.timeout(120000) - await localServer.follows.follow({ targets: [ remoteServer.url ] }) + await localServer.follows.follow({ hosts: [ remoteServer.url ] }) await waitJobs(servers) await uploadWrapper('video 4 server 2')